"Melson" <we****@hotmail.com> wrote:
Can anyone help. I would like to replace the keys on the PC keyboard. For
example, when I press Q button it displays A on the screen in any programs
(MS Words, Note, Lotus....). And also when I press Ctrl + W button, it
displays G on the screen. I would like to make the keyboards configurable.
Should I write a Windows Service? Any suggestions would really appreciate.
Three suggestions for you to look at:
(1) SetWindowsHookEx() with WH_KEYBOARD_LL for a low-level keyboard hook
(this requires an application with a message loop running on the desktop
of the user it affects).
(2) Write a Windows keyboard layout with the MS Keyboard Layout Creator
(
http://www.microsoft.com/globaldev/tools/msklc.mspx).
(3) Install a keyboard filter driver into the kernel, and have your
configuration program communicate with it somehow. Check out
http://www.sysinternals.com/Utilities/Ctrl2Cap.html for techniques for
this (source is on the site, DDK needed IIRC). I wouldn't recommend this
method, since it could compromise the stability of the system.
I personally use (1), an application I wrote to simulate the Dvorak
keyboard layout for use with public PCs which don't allow permission to
change the keyboard layout. The catch with (1) is that some of the key
information you get depends on the current keyboard layout.
-- Barry
--
http://barrkel.blogspot.com/