Skip to content

Remapping keys like "Windows" #43

Open
@guraltsev

Description

@guraltsev

Hello,

First of all, I would like to thank you for this great software! It is true that it is quite complex and scary at first but yesterday I mustered up the courage to switch from the windows layout manager to using this program. I will not go back!

I was already using a small AHK script to remap tapping the LWin key to issuing a shortcut. Normally on Windows, if you tap the LWin key it opens the start menu. Then if you start typing it starts searching for a program. However, there are much better launchers than the start menu e.g. https://keypirinha.com/. One cannot bind to the tap of the 'LWin' key directly (thank you Microsoft for your usual monopolistic behavior ). So the following AHK script detects "pure" LWin keypresses and sends out a shortcut Alt+Space if LWin was pressed alone

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


; If windows key gets pressed alone then send alt-space
LWin up::
If (A_PriorKey = "LWin") ; LWin was pressed alone
    Send, ^!w
return


; But still make LWin have its original function 
<#d:: Send #d  ; <# means LWin

Could such functionality be included in your program, i.e. remapping the LWin key and not using it as a modifier?

Apart from this suggestion I have the following question/issue. My script is actually in slight conflict with EPKL: It cannot detect "purity" of the keypress. I have the shortcut LWin+` to open a drop-down terminal. Before, pressing that shortcut did not trigger the AHK script. With EPKL, however, the logic does not work anymore, and even if I press LWin+` it sends out the shortcut on the release of the LWin key. Any suggestions?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions