Using windows 11 I want to insert the current date and time into a text field on detection of Ctrl-t keypress. As far as I can tell the following code should work but does not. The text area is not read only, ‘t’ alone works, but Ctrl-t elicits nothing. What am I missing? This is the key down event of the control.
if key=“t” and Keyboard.ControlKey then
var d as string =DateTime.Now.SQLDateTime
me.AddText(d)
return true
else
return false
end if
Thanks for the suggestions, this one works for now and is here for reference, the menu addition also a good idea should I wish to add further options down the line.
if Keyboard.ControlKey and key=chr(20) then
var d as string = DateTime.Now.SQLDateTime
me.AddText(d)
return true
else
return false
end if
I like your basic logic (no need to test the Control-Key…)
I needed to test the Control Key, then I tested what value Key As String is in the Debugger… Then, and only then, I tested Chr(20).