Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Text := "
- (
- ■ホットキーすり抜け再現スクリプト■
- === すり抜け条件 ===
- ・修飾キーを入力(ホットキー、Send)
- ・高速で過剰な入力(ホイール回転など)
- ・PC負荷が掛かっている状態
- === テスト用ホットキー ===
- Shift + ホイール上回転 → u (すり抜け:大文字)
- Shift + ホイール下回転 → d
- Shift + z → x
- Ctrl + ホイール下回転 → a (すり抜け:すべて選択)
- === ホットキーすり抜け対策 ===
- [BlockInput Send] ※管理者権限が必要、ただし高負荷時では完全には防げない
- ↓大文字+1文字でログを表示↓
- )"
- ; === 負荷設定(多重起動)、問題が再現しない場合は増やす ===
- ; Startup = 0
- ; Startup = 1
- Startup = 50
- ; Startup = 100
- ; Startup = 200
- #NoEnv
- #NoTrayIcon
- #SingleInstance Off
- #KeyHistory 500 ; Default 40
- #MaxHotkeysPerInterval 400 ; 70
- #InstallKeybdHook
- #InstallMouseHook
- SetBatchLines -1 ; 10
- if !A_Args.Length() { ; メインスクリプトのみ
- OnExit ExitSub
- Menu, Tray, Icon
- Loop %Startup% {
- Run %A_ScriptFullPath% %A_Index%,,, Pid
- GroupAdd, TestGroup, ahk_pid %Pid%
- }
- Gui, New, +AlwaysOnTop +HwndGuiHwnd
- Gui, Add, Text,, %Text%
- Gui, Add, Edit, w450 r10 gErrorCheck
- Gui, Add, Button, w150 gBlockButton, BlockInput Send
- Gui Show
- KeyHistory
- }
- return
- ErrorCheck: ; エラー時にログを表示
- GuiControlGet, Text,, Edit1
- if (Text ~= "^.*[A-Z].$") { ; 大文字+1文字
- BlockInput On ; 過剰な入力を抑制
- KeyHistory
- ControlSend,, ^{End}, ahk_id %A_ScriptHwnd%
- BlockInput Off
- }
- return
- BlockButton:
- BlockInput % (BlockMode:=!BlockMode) ? "Send" : "Default" ; Send中の過剰な入力を抑制
- GuiControl,, Button1, % "BlockInput " (BlockMode ? "Default" : "Send")
- GuiControl,, Edit1
- GuiControl, Focus, Edit1
- return
- ExitSub:
- DetectHiddenWindows On
- WinKill ahk_group TestGroup ; 多重起動も全終了
- GuiEscape:
- GuiClose:
- ExitApp
- #If !A_Args.Length() && WinActive("ahk_id" GuiHwnd) ; メインスクリプト & テスト用GUIのみ
- +WheelUp::SendInput u
- +WheelDown::SendInput d
- +z::SendInput x
- ^WheelDown::SendInput a
- #If
Add Comment
Please, Sign In to add comment