Page 1 of 1

Getting pressed key.

Posted: Sun May 08, 2005 8:11 am
by VonGodric

I have small problem ( I'm wx Newby ) I'm workin on small editor in what I have wxStyledTextCtrl. how can I get an event or smth if Ctrl key is held down? I need it so I can enable/disable hotspot in StyledTextCtrl.

I know I can activate hotspot before hand and then read if (event.GetControl()) But I don't like it this way. I want first to get if ctrl key is pressed and then enable for the time being hotspot and when ctrl is released then disable.

(A screenshot of the FBIde is here:

Thanks in advance.

Posted: Sun May 08, 2005 9:37 am
by Avi
Will wxGetKeyState help you? (use it with the following Keycodes)

Posted: Sun May 08, 2005 9:45 am
by Avi
Also, you might wanna look into catching some wxKeyEvents... ;)

Posted: Sun May 08, 2005 1:17 pm
by VonGodric
Thank you, that really helped :P