Remapping hotkeys on a Lenovo W540 laptop

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Annorax
Posts: 1
Joined: 24 Jan 2018, 10:11

Remapping hotkeys on a Lenovo W540 laptop

24 Jan 2018, 10:17

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?
User avatar
divanebaba
Posts: 816
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Remapping hotkeys on a Lenovo W540 laptop

25 Jan 2018, 05:33

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
Einfach nur ein toller Typ. :mrgreen:
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: Remapping hotkeys on a Lenovo W540 laptop

25 Jan 2018, 10:52

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.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CoffeeChaton, Google [Bot] and 183 guests