Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create one application which required hotkey but my algorithm is not working properly.My algorithm only works when application is on top otherwise it is not working.
Posted

Take a look at the following code project article, Simple steps to enable Hotkey and ShortcutInput user control[^], very neatly explained.
 
Share this answer
 
To create a keyboard shortcut for an application:

Choose Apple menu > System Preferences, and then click Keyboard & Mouse.


Click Keyboard Shortcuts, and then click the Add (+) button.


Choose an application from the Application pop-up menu. If you want to set the same key combination for a menu command that appears in many applications, choose All Applications.

If the application you want to select does not appear in the list, choose Other and locate the application using the Open dialog. Some applications may not allow you to set keyboard shortcuts.


Type the menu command for which you want to set a keyboard shortcut in the Menu Title field.

You must type the command exactly as it appears in the application menu, including ellipses and any other punctuation. An ellipsis is a special character that looks like three periods. To type an ellipsis, press Option-semicolon, or use the Character Palette. It may be difficult to know whether the command is written in the menu with a real ellipsis or with three periods, so if one does not work, try the other.


Click in the Keyboard Shortcut field and press the key combination that you want to assign to the menu command, and then click Add.

You cannot use each type of key (for example, a letter key) more than once in a key combination.


Quit the application for which you added or changed a keyboard shortcut.


Restart the application to see the keyboard shortcut in the application’s menu.
 
Share this answer
 

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