ThinkVantage Key and SetWindowsHookEx
ThinkVantage Key and SetWindowsHookEx
I wrote a small c++ program to trap a ThinkVantage key press, but pressing the key does not generate any keyboard input. Has anyone else tried this?
I'm working on a clean-install so I may be missing a driver. Although, I did install the hotkey driver and the keyboard customizer utility.
Here's the hook procedure:
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if( nCode < 0 )
{
return ::CallNextHookEx(g_keyboardHook, nCode, wParam, lParam );
}
KBDLLHOOKSTRUCT* kbd = reinterpret_cast<KBDLLHOOKSTRUCT*>(lParam);
if( kbd->vkCode != THNIKVANTAGE_KEYCODE )
return ::CallNextHookEx(g_keyboardHook, nCode, wParam, lParam );
::ShellExecute(NULL, L"open", L"c:\\windows\\system32\\notepad.exe", NULL, NULL, SW_SHOW);
return STOP_PROCESSING;
}
I'm working on a clean-install so I may be missing a driver. Although, I did install the hotkey driver and the keyboard customizer utility.
Here's the hook procedure:
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if( nCode < 0 )
{
return ::CallNextHookEx(g_keyboardHook, nCode, wParam, lParam );
}
KBDLLHOOKSTRUCT* kbd = reinterpret_cast<KBDLLHOOKSTRUCT*>(lParam);
if( kbd->vkCode != THNIKVANTAGE_KEYCODE )
return ::CallNextHookEx(g_keyboardHook, nCode, wParam, lParam );
::ShellExecute(NULL, L"open", L"c:\\windows\\system32\\notepad.exe", NULL, NULL, SW_SHOW);
return STOP_PROCESSING;
}
Perhaps ThinkPad HotKey features ate the keystroke?
If WH_KEYBOARD_LL cannot trap it, I highly doubt WH_KEYBOARD can.
Does "Fn" key generate a call to your LowLevelKeyboardProc?
What are you trying to accomplish? If you want to override the action for ThinkVantage key, changing this value is easier:
[HKEY_LOCAL_MACHINE\SOFTWARE\IBM\TPHOTKEY\8001]
If WH_KEYBOARD_LL cannot trap it, I highly doubt WH_KEYBOARD can.
Does "Fn" key generate a call to your LowLevelKeyboardProc?
What are you trying to accomplish? If you want to override the action for ThinkVantage key, changing this value is easier:
[HKEY_LOCAL_MACHINE\SOFTWARE\IBM\TPHOTKEY\8001]
X61
I've tried disabling it...Perhaps ThinkPad HotKey features ate the keystroke?
Yes...Does "Fn" key generate a call to your LowLevelKeyboardProc?
That was the first thing I tried. Apparently there's some software that must be installed for that to work (and I'm trying to minimize the number of running processes so I'd rather not install it anyway).If you want to override the action for ThinkVantage key, changing this value is easier:
[HKEY_LOCAL_MACHINE\SOFTWARE\IBM\TPHOTKEY\8001]
I tried WH_KEYBOARD - no luck.
Unix has a utility called tpb that enables the thinkpad button for that platform. Looking at the source for tpb, they are reading from /dev/nvram for the button state. Does anyone know if there is an equivalent operation on Windows?
Here's a link to the relevant source file:
http://www.google.com/codesearch?hl=en& ... inkpad.cpp
Unix has a utility called tpb that enables the thinkpad button for that platform. Looking at the source for tpb, they are reading from /dev/nvram for the button state. Does anyone know if there is an equivalent operation on Windows?
Here's a link to the relevant source file:
http://www.google.com/codesearch?hl=en& ... inkpad.cpp
-
- Similar Topics
- Replies
- Views
- Last post
-
-
IBM- Lenovo T61- how to run the ThinkVantage button
by Radovan-kocour » Sun Mar 12, 2017 3:19 pm » in ThinkPad T6x Series - 1 Replies
- 926 Views
-
Last post by RealBlackStuff
Mon Mar 13, 2017 4:27 am
-
-
-
PC Doctor ThinkVantage Toolbox -- WinXp 32-bit
by SimonA » Fri Mar 24, 2017 4:37 am » in Windows OS (Versions prior to Windows 7) - 2 Replies
- 1084 Views
-
Last post by Haxoc112
Mon May 29, 2017 9:00 pm
-
-
- 3 Replies
- 623 Views
-
Last post by Brad
Tue Jan 03, 2017 1:27 pm
-
-
Broke middle scroll key x230
by blink » Sun Feb 19, 2017 9:20 pm » in ThinkPad X230 and later Series - 3 Replies
- 503 Views
-
Last post by blink
Tue Feb 28, 2017 9:04 pm
-
Who is online
Users browsing this forum: No registered users and 5 guests





