Page 1 of 1

Remapping hotkeys on a Lenovo W540 laptop

Posted: 24 Jan 2018, 10:17
by Annorax
Hi all,

I'm trying to use AutoHotkey on Windows 7 Professional to remap some of the special keys on a Lenovo W540 laptop. Above the number pad, there are 4 keys: Calculator, Lock Computer, Web Browser, and Windows Explorer. I want to remap 3 of them to Volume Mute, Volume Up, and Volume Down. I was able to successfully remap the Calculator and Web Browser keys with the below script, however the Windows Explorer Key will not map despite me using Launch_App1 (it still launches Explorer/Computer) and I'm not sure if it's possible to remap the Lock Computer key at all.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Launch_App2::Volume_Mute
Browser_Home::Volume_Down
Launch_App1::Volume_Up
Can someone please help me remap these last 2 keys?

EDIT:

Upon further study and use of "#InstallKeybdHook", it seems that those buttons actually correspond to LWin+e and LWin+l. I see that remapping the Lock Computer key can be difficult so I'm OK with remapping just the Explorer key and did so via this line:

Code: Select all

#e::Volume_Up
However, if I press it fast, the Windows Start menu pops up instead of the volume changing. Is there any way to suppress this?

Re: Remapping hotkeys on a Lenovo W540 laptop

Posted: 25 Jan 2018, 05:33
by divanebaba
I recommend to find the scan code of the keys.
Look for instructions on this page in help-file.

Overwriting #e seems, in my opinion, not a good idea.
For volume manipulations I prefer
$^UP::Volume_Up
$^DOWN::Volume_Down

Re: Remapping hotkeys on a Lenovo W540 laptop

Posted: 25 Jan 2018, 10:52
by qwerty12
Hi,

If you use Process Monitor with the following filters:
  • Process Name is shtctky.exe then Include
  • Path contains SOFTWARE\Lenovo\ShortcutKey\AppLaunch then Include
do you get hits in procmon.exe when pressing your dedicated Explorer / Lock Computer key? If you do, you can have the Lenovo hotkey software start an AutoHotkey script when those dedicated keys are pressed - look in the AppLaunch key for examples.