AutoHotkey V1→V2

https://www.autohotkey.com

非互換で動かなかったので修正した。

キーのリマッピング
https://ahkscript.github.io/ja/docs/v2/misc/Remap.htm

; 矢印キー × 5
^*Up::
{
	Send "{UP 5}"
}

^*Down::
{
	Send "{Down 5}"
}

^*Left::
{
	Send "{Left 5}"
}

^*Right::
{
	Send "{Right 5}"
}

; 削除
^*h::
{
	Send "{BS}"
}

; ディスプレイ情報取得
getDisplayInfo(&x, &y, &height, &width)
{
	MonitorGetWorkArea(1, &Left, &Top, &Right, &Bottom)
	OutputDebug("Left=" . Left . " Top=" . Top . " Right=" . Right . " Bottom=" . Bottom)
	x := Left
	y := Top
	height := Bottom - Top
	width := Right - Left
}

; 画面左移動
!1::
{
	getDisplayInfo(&x, &y, &height, &width)
	hwnd := WinGetID("A")
	WinMove(x, y, width/2, height, hwnd)
}

; 画面中央
!2::
{
	getDisplayInfo(&x, &y, &height, &width)
	hwnd := WinGetID("A")
	WinMove(width*0.1, y, width*0.8, height, hwnd)
}

; 画面右移動
!3::
{
	getDisplayInfo(&x, &y, &height, &width)
	hwnd := WinGetID("A")
	WinMove(x + width/2, y, width/2, height, hwnd)
}

; 音量調整
^F10::
{
	Send "{VOLUME_MUTE}"
}

^F11::
{
	Send "{VOLUME_DOWN}"
}

^F12::
{
	Send "{VOLUME_UP}"
}

Ctrl + 矢印キー:矢印キー5回連打
Ctrl + hキー :BackSpace
Alt + 1キー :アクティブ画面左寄せ
Alt + 2キー :アクティブ画面中央寄せ
Alt + 3キー :アクティブ画面右寄せ
Ctrl + F10 :音量ミュート
Ctrl + F11 :音量Down
Ctrl + F12 :音量UP

無変換キー:IMEオフ*
変換キー:IMEオン*

*:Windowsの機能で設定。タスクバーの「あ」-「設定」-「キーとタッチのカスタマイズ」

既知の問題点

Alt + 数字 で アクティブ画面を移動したときに数ピクセルずれる。画面まわりの影分のピクセルを考慮する必要があるけど放置する。Windows 11のスナップ機能で代替可能(Winキー + 矢印キー)なのでいらなくなる予定。

Windows 11のスナップ機能

最大化、最小化、スナップ……[Windows]+矢印キーでウィンドウを自在に操る
https://forest.watch.impress.co.jp/docs/shseri/usefulkeys/1431434.html

デスクトップを分割・複数のアプリを並べる「スナップ レイアウト」がよりスマートに
https://forest.watch.impress.co.jp/docs/news/insiderpre/1563875.html

Rectangle

macOSでは、Rectangle を使用していたのでこれも貼っておこー

Rectangle
https://rectangleapp.com/

Spectacle
https://github.com/eczarny/spectacle

Caps Lockキーを左Ctrlキーに置換

https://ahkscript.github.io/ja/docs/v2/KeyList.htm#IME

AutoHotkey V2.0では、Caps Lockキーが扱えるのかもしれないけど従来どおりChange Keyで置き換えたのでこれも貼っておこー

Change Key
https://forest.watch.impress.co.jp/library/software/changekey

Sysinternals Ctrl2Cap
https://learn.microsoft.com/ja-jp/sysinternals/downloads/ctrl2cap

KeyTweak
https://www.bleepingcomputer.com/download/keytweak/


Comments

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です