Click here to Skip to main content
Click here to Skip to main content

Mobile Development: Hooking the keyboard – KeyToggle

, 15 Jul 2010
Rate this:
Please Sign up or sign in to vote.
Using keyboard hook to remap keys to function keys on windows mobile.

KeyToggle

Extend your keyboard to get function keys by pressing numbers.

With keytoggle you can define a ‘sticky’ key that will change the beahviour of the number keys. As long as the sticky key is ‘active’, number keys from 1 to 0 will produce the function keys F1 to F10. If sticky key is active, the left LED will light in green.

To start keytoggle just tap it or let it start by a link in StartUp. If keytoggle is loaded, you can see a small yellow arrow sign in the taskbar.

If you tap this symbol, you are asked, if you want to unload the app. If the registry does not have values defined for keytoggle, it will use default values. If you try to launch keytoggle a second time you will get a message box. Only one instance of keytoggle can run at a time.

Using the registry you can define the behaviour of the sticky key. In example, you can have the sticky key remain active until it is pressed again, let it ‘go off’ or ‘fallback’ after a period of time or let it fallback after a number key has been pressed. If the sticky key is pressed again, it will always fallback.

REGEDIT4
[HKEYLOCALMACHINE\SOFTWARE\Intermec\KeyToggle]
“Timeout”=dword:00000000
“autoFallback”=dword:00000001
“StickyKey”=dword:00000090

The values:

  StickyKey:
  default "144", decimal (VK_NUMLOCK)
  the VK_ value of the sticky key. Here you define, what you will have as the sticky key. 
  VK_ values are defined as in winuser.h. In example the VK_ value for the 
  NumLock key is 0x90 (144 decimal, see VK_NUMLOCK). The sticky key will be 
  consumed by keytoggle and is not visible to the system any more. That means, 
  that you should choose key value that you do not need in any app you use.

  Timeout:
  default "3", three seconds
  number of seconds the sticky key will remain active. If 0, the sticky key will
  not fallback automatically by time

  autoFallback:
  default "0"
  if 0 the sticky key will not fallback after pressing a number key. If 1 the sticky
  key will fallback after a number key is pressed

Launch arguments

  Keytoggle only supports one argument: "-writereg". This will create the
  registry keys used by keytoggle and fill them with the default values.

Usage Sample Scenario

You have a ITC Color device with a numeric keyboard but no function keys. You need the function keys to be able to use a web application within iBrowse. With keytoggle you can now for example use the Gold key as sticky key. You have to download the device reource kit to get a keyboard remapper tool from the ITC site and assign the Gold key to NUMLOCK.

With this remapping and keytoggle running you will to get a function keystroke simulated if you press the Gold key and then a number key.

Download installer: DOWNLOAD:KeyToggle Installer CAB - (Hits: 1, size: 5.19 kB)

License

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

About the Author

hjgode

Germany Germany
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 16 Jul 2010
Article Copyright 2010 by hjgode
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid