Home » Community » Newbie corner » How to monitor key release event?
How to monitor key release event? [message #43049] |
Sun, 27 April 2014 01:01  |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I am writing small platformer game with map editor and I would like to handle key release events. Is there any way to do this in current version of U++?
What I have spied is that Ctrl::Key(dword key, int count) returns two events(X11):
Key: 130897, 1 // <- Key press event.
Key: 1179475, 1 // <- Key release event.
Of course I can handle it manually (by absolute key value), but it isn't elegant solution and probably it isn't platform independent.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 27 April 2014 01:04] Report message to a moderator
|
|
|
|
|
|
|
|
Re: How to monitor key release event? [message #44251 is a reply to message #44243] |
Thu, 12 February 2015 20:58  |
ManfredHerr
Messages: 67 Registered: February 2013 Location: Germany
|
Member |
|
|
Hi,
thank you for responding, I hardly can believe it!
To make it clear: I don't want to have a key-logger! I just want to monitor the keyboard events then when my application has the input focus, with key press and key release info in the proper time. It seems that this is possible in a portable way despite of security issues. But how you do it in UPP?
In the meantime, I decided to go back to FLTK that provides better support on that, and claims to be portable too. Sorry.
My intent is, to assign a particular function to a set of keys of the keyboard, that can be invoked independent and in parallel, as long as the key is pressed. This function has nothing to do with text. To give an example: In former days there were games for two players. Each of the two controlled an object (his object), one of them with the cursor keys and the other with the keys 'A','W','D','X'. I see, that nowadays both players have a computer of their own and play over the network. So, that every one has his keyboard and cursor keys available. However, it's an example only.
Regards
Manfred
|
|
|
Goto Forum:
Current Time: Tue Apr 29 01:47:06 CEST 2025
Total time taken to generate the page: 0.01134 seconds
|