add: ahk & install script

This commit is contained in:
qwjyh 2022-10-06 22:20:08 +09:00
parent ad585e1444
commit 10de79427e
3 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# Install script for AHK key remapping
# Be sure to install AutoHotKey first
# check working directory
if (!(
(Test-Path bin) -and (Test-Path dotfiles)
)) {
Write-Warning -Message "wrong current path
please execute at repo root"
exit 1
}
# set Ahk2Exe.exe path
# example "C:\Program Files\AutoHotKey\Compiler\Ahk2Exe.exe"
$ahk2exe_path = "C:\Program Files\AutoHotKey\Compiler\Ahk2Exe.exe"
## end config
if ($null -eq $ahk2exe_path) {
exit
}
# compile
& $ahk2exe_path /in .\dotfiles\ahk\key_remaps.ahk /out dotfiles\ahk\key_remaps.exe
# add to startup folder
$startup = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\"
Copy-Item .\dotfiles\ahk\key_remaps.exe $startup
Write-Output "Finished!"

1
dotfiles/ahk/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.exe

View file

@ -0,0 +1,64 @@
; basic key remapping for windows(JIS keyboard)
; using AutoHotKey
#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%1
; KeyHistory
#UseHook
; ==========================================
; 変換/無変換 + ASDF/HJKLのショートカット
vk1D::
Send, {vk1D}
Return
vk1C::
Send, {vk1C}
Return
; 十字キーの設定
; hjkl like vim
vk1D & h::
vk1C & h::
Send,{Blind}{Left}
return
vk1D & j::
vk1C & j::
Send,{Blind}{Down}
return
vk1D & k::
vk1C & k::
Send,{Blind}{Up}
return
vk1D & l::
vk1C & l::
Send,{Blind}{Right}
return
; Home,End,PgUp,PgDnの設定
; a s d f
; Home PgUp PgDn End
vk1D & a::
vk1C & a::
Send,{Blind}{Home}
return
vk1D & f::
vk1C & f::
Send,{Blind}{End}
return
vk1D & s::
vk1C & s::
Send,{Blind}{PgUp}
return
vk1D & d::
vk1C & d::
Send,{Blind}{PgDn}
return
; ==========================================
; HankakuZenkaku to esc
sc029::
Send, {Escape}