Click to See Complete Forum and Search --> : Keyboard Events
bdonegan
December 1st, 2005, 01:10 PM
Hi,
Quick question here on working with the keyboard. Basically i want to know how to check if a specific key is pressed at any given time (specifically the Shift key) Any ideas?
NoHero
December 1st, 2005, 02:21 PM
On a form you can handle KeyPressed() event, which is fired everytime the user presses a key inside the form.
bdonegan
December 1st, 2005, 02:50 PM
Not quite what I'm looking for. Basically i want to be able to implement a shift-click, i.e., one thing happens when the Shift key is depressed when the mouse is clicked and another happens if it is not. Anyone out there know how to do this?
humptydumpty
December 1st, 2005, 11:57 PM
hust implement hook on your keyBoard and check for the Message you will get everything what ever u want
NoHero
December 2nd, 2005, 05:55 AM
hust implement hook on your keyBoard and check for the Message you will get everything what ever u want
The OP might be looking for a managed solution though. Although I am not aware of one yet. I will take a look at it.
bdonegan
December 3rd, 2005, 03:11 PM
well, i'm not sure if there will be a difference, but i am programming in managed code. i should be able to translate a sample bit of code from standard c++ if you can provide me with one...
NoHero
December 3rd, 2005, 03:56 PM
well, i'm not sure if there will be a difference, but i am programming in managed code. i should be able to translate a sample bit of code from standard c++ if you can provide me with one...
I have done a search and frankly I wasn't able to find one. You can still try HD's solution or use GetAsyncKeyState() function from the native Windows SDK.
ZOverLord
December 24th, 2005, 06:49 AM
Here is an example, it is done in MASM32, however you can read it and port it to c++ very easily:
http://www.codeguru.com/forum/showthread.php?p=1296520#post1296520
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.