Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
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
-
-
X1 carbon gen 5 and 6 keyboard and power button assembly interchangeability
by dcfbf » Mon Dec 15, 2025 4:15 pm » in ThinkPad X1 / X1-Carbon / X1-Extreme and later Series - 3 Replies
- 11532 Views
-
Last post by dcfbf
Wed Jan 21, 2026 2:32 pm
-
-
-
Battery use and charging etiquette for Classic ThinkPads?
by johnny1093 » Wed Oct 29, 2025 1:50 pm » in Thinkpad - General HARDWARE/SOFTWARE questions - 2 Replies
- 15163 Views
-
Last post by johnny1093
Sat Nov 01, 2025 8:46 pm
-
-
-
WTB: T60/T60p 15” palm rest and keyboard bezel
by stanleylieber » Fri Oct 31, 2025 4:32 pm » in Marketplace - Forum Members only - 3 Replies
- 6773 Views
-
Last post by KAQSP
Thu Nov 20, 2025 6:33 pm
-
-
-
W520 and WiFi connection speed issue
by jdwis » Sat Nov 01, 2025 7:11 am » in ThinkPad W500/W510/W520 and W700/W701 Series - 8 Replies
- 24948 Views
-
Last post by jdwis
Wed Nov 12, 2025 11:57 am
-
Who is online
Users browsing this forum: No registered users and 48 guests





