Click here to Skip to main content
13,292,723 members (66,556 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 3 Aug 2010

Mobile Development: another keyboard hooking tool: keyToggleCtrl

, 3 Aug 2010
Rate this:
Please Sign up or sign in to vote.
An application that works in the background using a keyboard hook.


This is again a keyToggle application - an application that works in the background using a keyboard hook.

After keyToggleCtrl has been started, it will install a keyboard hook and watches the keyboard messages for the appearance of the toggle, or as I call it, the sticky key.

When the sticky key is detected, keyToggle Ctrl will watch the keyboard messages for the keys listed in a keytable (default is watching for presses of the number keys 0 to 9). If the pressed key matches a key in the keytable, keytogglectrl will remove the message from the window message queue and instead send the key found in CharTable with Control pressed before and released after the replaced key.

For example, you press the sticky key, the LED defined by LedID should light and if you then press 0, keyToggleCtrl will send instead Control+C to the active application.


Without keyToggleCtrl, you have to show the SoftwareInputPanel (SIP), tap the [Ctrl] button and then the ‘C’ and then hide the SIP. With keyToggleCtrl, you can just use the hardware keyboard and have Ctrl+C (Copy to Clipboard) and Ctrl+V (Paste from Clipboard) at your fingers.

After you started keyToggleControl, you will only notice a small symbol on the Today Screen of your device. If you tap the symbol, you have the chance to end the keyboard hook and the keyToggleCtrl application.

KeyToggleCtrl Today Screen

Default key mapping with use of -writereg:

Keytable 0 0x30 -> 0x0043, '0 -> 'C'
Keytable 1 0x31 -> 0x0058, '1 -> 'X'
Keytable 2 0x32 -> 0x0057, '2 -> 'W'
Keytable 3 0x33 -> 0x0054, '3 -> 'T'
Keytable 4 0x34 -> 0x0045, '4 -> 'E'
Keytable 5 0x35 -> 0x0058, '5 -> 'X'
Keytable 6 0x36 -> 0x0057, '6 -> 'W'
Keytable 7 0x37 -> 0x0054, '7 -> 'T'
Keytable 8 0x38 -> 0x0045, '8 -> 'E'
Keytable 9 0x39 -> 0x0056, '9 -> 'V'

These values are the same as ANSI codes or VK_ values found in winuser.h.

  • Default sticky key is VK_PERIOD
  • Sticky timeout is 3 seconds
  • Autofallback is 0
  • LedID default is 1

To find a usable LedID, you may use another tool called LED_Control. Funny, the vibrate motor is also controlled with the same LED API calls.

LED_control IMAGE

<!-- Social Bookmarks BEGIN --> <!-- Social Bookmarks END -->


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


About the Author

Germany Germany
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 3 Aug 2010
Article Copyright 2010 by hjgode
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid