Giter Club home page Giter Club logo

alt-convert-key's Introduction

alt-convert-key

概要

[左Alt] を短くタップすると [無変換] キーとして、 [右Alt] を短くタップすると [変換] キーとして動くようにする AutoHotKey スクリプト。

[無変換] [変換] キーがない US-ASCII 配列キーボードなど向け。

英語を入力するときには [左Alt] を短くタップ、日本語を入力するときには [右Alt] を短くタップ、のように使います。 それまでの入力モードが日本語か英語かを気にしなくて良くなります。

特徴

  • [Alt] のタップで [無変換] [変換] を入力したことにする
    • タップ: キーを押してから 200ms 以内に離したとき
  • [Alt] 長押し中にほかのキーを入力すると、通常の [Alt] との組み合わせとして動作する
  • [Alt] タップ中のアルファベット入力は、離した時に [Alt] なしの普通のアルファベット入力扱いとする
    • ほかのキーは押し下げた時に入力なのに、 [無変換] [変換] は戻したときに入力とすると、素早く入力したときに誤って [Alt] + [F] などが発動することを防ぐ
  • [Alt] 長押しで [Alt] を押したことにするオプションあり
    • タップのつもりで長押しになると意図しないメニューを実行してしまうため、標準はオフ

使用前の準備

  • AutoHotkey をインストール
  • IME のキー設定を、無変換キーを IME オフ、変換キーを IME オンに割り当てる
    • Microsoft IME (Windows 10 Ver.2004 以降) の場合:
      • [Windows の設定] > [キーとタッチのカスタマイズ] を開く
      • 無変換の割り当てを IME オフ にする
      • 変換の割り当てを IME オン にする
    • Google 日本語入力 – Google の場合:
      • Google 日本語入力のプロパティから、キー設定の選択を編集
      • 以下のように設定
モード 入力キー コマンド
入力文字なし Muhenkan IMEを無効化
入力文字なし Henkan ひらがなに入力切替
直接入力 Henkan ひらがなに入力切替
変換前入力中 Muhenkan IMEを無効化

使用方法

alt-convert-key.ahk ファイルをエクスプローラーでダブルクリックして開始します。

タスクバー右の通知領域にある AutoHotKey アイコンから、一時停止・終了できます。

技術メモ

  • IME.ahk (Win32 API) を使わない
    • AutoHotKey 以外でも同じように書けるはず
  • [Alt] を押したとき、同時に [F14] を押したことにすることにより、メニューバーへのフォーカスを回避している
    • アプリによっては [Alt] でメニューを出す処理をカスタマイズしていることがあり、その場合はうまく動かない場合あり
    • [F14] はほかの未使用キーでも可。以前は vk07 が使えたけれど、Windows 10 Ver.1909 以降はゲームバーに割り当てられたと AutoHotKey ヘルプにあり、こちらにした。
  • [Alt] 長押しオプションを立てると、 [Alt] を離した後にもう一度 [Alt] を押したことにする
    • 特殊なことをしているため、[Alt] 単独で押すことがあるならスクリプトを一時停止したり、別に [Alt] キーを割り当てるのをお勧めします

公開ページ

参考

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.