![AutoHotkeyで録画機能つくる](https://take-web.com/auto/wp-content/uploads/2020/12/Autohotkey-Recoder_make.png)
![](http://take-web.com/auto/wp-content/themes/cocoon-master/images/man.png)
UWSCが閉鎖されたようなので、Autohotkeyでキー録画できないか調べています。難しい。
AutoHotkeyのダウンロード先:
KeyHistoryでキー・マウスの状態を知る
#h::
KeyHistory
Return
これでは、キー押したときとかを知ることできない。API使わないとダメなのか?
![キー何を押したか知りたい](https://take-web.com/auto/wp-content/uploads/2020/12/keyHistory.png)
履歴が表示されるだけ
GitHubでAutoHotkey Recorder関係読んで見る
うまく動かない。我流で直す。
inputコマンドで押されたキーを取得できるようです
Input [, OutputVar, Options, EndKeys, MatchList]
ユーザーの入力を横取りして取得する
Input, UserInput, V L50, {Enter}
キータイプ数、最大50終わりのキーは「Enter」
Enterが入力されると、横取りされInputコマンドが終了します。そのため、エディタなどだとEnterが貼り付けられません。
FileAppend, (LTrim `n Send, %UserInput% Send, {Enter} ;<<<<<<< これを追加しました %text2% ), %whatfile%
左ダブルクリックを検知する
~LButton::
If (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 300)
cnt_L := 2
Return
ピュアドキュメントを左に揃える
FileAppend, ( Exit Esc:: ExitApp ExitApp ), %whatfile%
()の中に入れたテキストは、そのまま表示されるようです。
上のようなコードだと左に空白・タブが表示されてしまいます。
![tab_space あり](https://take-web.com/auto/wp-content/uploads/2020/12/tab_space.png)
白枠部分が邪魔です。
なくすには:
(LTrim をつけます
コメント