Getting pressed key.

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
VonGodric
Earned some good credits
Earned some good credits
Posts: 103
Joined: Sun Jan 30, 2005 9:31 pm
Contact:

Getting pressed key.

Post by VonGodric » Sun May 08, 2005 8:11 am

Hello,

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: http://forums.wxwidgets.org/viewtopic.php?t=2109

Thanks in advance.

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post by Avi » Sun May 08, 2005 9:37 am

Will wxGetKeyState help you? (use it with the following Keycodes)

Avi
Super wx Problem Solver
Super wx Problem Solver
Posts: 398
Joined: Mon Aug 30, 2004 9:27 pm
Location: Tel-Aviv, Israel

Post by Avi » Sun May 08, 2005 9:45 am

Also, you might wanna look into catching some wxKeyEvents... ;)

VonGodric
Earned some good credits
Earned some good credits
Posts: 103
Joined: Sun Jan 30, 2005 9:31 pm
Contact:

Post by VonGodric » Sun May 08, 2005 1:17 pm

Thank you, that really helped :P

Post Reply