Customized Keyboard Shortcut Keys Using C++ and Virtual Keys

Hi ! This post is intended to those people who prefer to use a keyboard shortcut rather than switching from Keyboard to Mouse for open...

Hi !


This post is intended to those people who prefer to use a keyboard shortcut rather than switching from Keyboard to Mouse for opening their most frequent things.
So, Here we are moving one step further and going to hard code some of these shortcut keys for our convenience.

Imagine you are Writing a program on notepad and then you have to open your CMD to compile and run it. It would be such a drag to move your hand from Keyboard to Mouse and then use it for opening. Or you want to open your Facebook account , or want to play Music. All this can be done with this Program.

If you want to open CMD , then type cmd anywhere and your CMD window will open.



Similarly, 
             For Media player: we will type music
             Stack Overflow  :  we will type stack
             Gmail                :  we will type gmail
             My Facebook Page: we will type nitish
             And,
             To close this program , Type exit .



The basic idea behind this is to identify keystroke, i.e. to identify which key is pressed. This is done by using getasynckeystate() function which comes under windows.h header file.
Once you can do that, You have to identify sequence of keystroke and then map those keystroke with some Program.

For full source code of this program, visit my Github page here.
For more information on Virtual Key Codes, visit this MSDN site.


Keep Coding!

You Might Also Like

0 comments

Total Pageviews

Flickr Images