2020年7月23日木曜日

英語キーボードでCapsLockに半角/全角を割り当てる

肩凝り対策でスプリットのキーボードBAROCCO MD770 RGBを使い始めました。英語配列なので半角と全角の切替が面倒です。デフォルトだとCapsLock+ShiftですがCapsLockだけで切り替えたいのでAutoHotKeyをインストールしました。デスクトップ上で右クリック、新規作成でAutoHotKeyの設定ファイルを新規作成して、6行目以降のの部分を追加します。
CapsLockで日本語/英語の切替、ESCキーを2回タイプで大文字/小文字を切り替えます。
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.  
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.  
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.  
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.  
  5.   
  6. CapsLock::  
  7.   Send, {vkF3sc029}  
  8.   return  
  9.   
  10. Esc::  
  11.   Keywait, Esc, U  
  12.   Keywait, Esc, D T0.3  
  13.   If (ErrorLevel=1{ 
  14.     Send,{Esc}  
  15.   }  
  16.   else { 
  17.     SetCapsLockState % !GetKeyState("CapsLock", "T") 
  18.   }  
  19.   return  
しばらくこれで使って身体を慣らします。

1 件のコメント :

  1. 英数入力で大文字小文字の切替を調べています。なぜか、大文字でロックされることあります。

    返信削除