Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am implementing shortcut key combination logic like
<br />
Ctrl + A

<br />
Ctrl + Alt + D


but now I am looking for a trick to implement keyboard key combination without hotkey combination like :A + D but not getting any right things.

So please help to implement it.

Updated

Currently I am not able to add key combination other than hotkey combination.because whenever I am pressing two keys like : A + D it returns only single keys ascii so I am not getting two keys combination.

I have used following stuff Global Shortcuts in WinForms and WPF
Posted
Updated 7-Jul-15 23:18pm
v7
Comments
Abhinav S 8-Jul-15 3:28am    
Sorry but your question is not clear. "Combination only keys"?
Ravi Kumhar 8-Jul-15 5:20am    
yes abhinav i have posted questoin as well as source link
Sergey Alexandrovich Kryukov 8-Jul-15 3:43am    
First of all, it depends on UI framework/library you are using; you did not tag it. And this is way too trivial. Look at the keyboard event, event arguments.
—SA

1 solution

Keyboards don't work like that: or rather keyboard drivers don't work like that.
There are three "modifier" keys which can be easily used in combination - SHIFT, CTRL, and ALT - but there is no "built in" mechanism for handling any pair of the other keys pressed in combination. It can probably be done - but you would have to do it all yourself using the KeyDown and KeyUp events, and recording what key is currently down and what isn't - and it's likely to cause some problems with "standard" keyboard input. (Why do you think all of these "combinations" in VS are "CTRL+K, key" sequences instead of combinations?)

Frankly, I think it probably going to be a lot of hassle to get right, and confuse users when you release it. I'd see if I could re-work my design instead, myself.
 
Share this answer
 
Comments
Ravi Kumhar 8-Jul-15 6:12am    
Thanx griff..:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900