質問: 画面上で押しているキーをレンダリングするwindowsユーティリティ 大人数のグループにリモートでトレーニングを行っており、多くのアプリケーションショートカットキーをカバーします。 mousepose の画面上のキーストロークの表示を見ました。 windowsに同様の製品はありますか?mouseposeの他の機能(ファンシーマウスポインターなど)は、私にとってはあまり役に立ちません。キーを押すosdだけです。
回答: この目的でautohotkey_lスクリプトを記述しました。それを実行するには、 autohotkey_l ( direct dl )を使用します。これはfossです。また、autohotkeyを使用すると、スクリプトをexeにコンパイルできます(単にahk2exe.exe /in displaypressedkeyonscreen.ahk /out displaypressedkeyonscreen.exe )。押されたキーのosdのようなまたは標準のツールチップをマウスカーソルの近くに表示できます。また、マウスボタンのクリックとホイールのスクロールも表示します。(フレームとぼかしは説明のために行われていることに注意してください。スクリプト自体は、妨害のないテキストのみを表示します) これがスクリプトです(コピーしてメモ帳に貼り付け、displaypressedkeysonscreen.ahkとして保存します)。#noenv #singleinstance force #installkeybdhook global keystates, mousestate, clickcount, idledelay, largedisplay idledelay=3000 largedisplay=1 ; 0 = tooltip near mouse pointer ; 1 = big pane at screen bottom if largedisplay { ;initializing gui ;modded func originated from http://www.autohotkey.com/board/topic/8190-osd-function/ sysget monitor, monitor guix := monitorleft guiw := monitorright - monitorleft guih := (monitorbottom - monitortop) * guiw * 0.00003 if (guih > ((monitorbottom - monitortop) * 0.3)) guih := (monitorbottom - monitortop) * 0.3 opacity=230 fname="tahoma" fsize:=guih * 0.65 ; really, pixel = 0.75 point, but with 0.75 lowercase letter with lower part (like "g") get cut fcolor=cccccc bcolor=222222 fformat="600" gui +lastfound +alwaysontop +toolwindow -caption gui margin, 0, 0 ;pixels of space to leave at the left/right and top/bottom sides of the window when auto-positioning. gui color, ffffff ;changes background color gui font, s%fsize% w%fformat%, %fname% ; 0x80 = ss_noprefix -> ampersand (&) is shown instead of underline one letter for alt+letter navigation gui add, text, c%bcolor% center +0x80 w%guiw% h%guih% backgroundtrans vblkosdctrlname, test test test gui add, text, c%fcolor% center +0x80 w%guiw% h%guih% backgroundtrans vblkosdctrlname2 xp-3 yp-3 , test test test winset exstyle, +0x20 ; ws_ex_transparent -> mouse klickthrough winset transcolor, ffffff %opacity% } traytip %a_scriptname%, to exit`, press the right windows logo key. loop { input singlekey, l1 v m i b, {lcontrol}{rcontrol}{lalt}{ralt}{lshift}{rshift}{lwin}{appskey}{f1}{f2}{f3}{f4}{f5}{f6}{f7}{f8}{f9}{f10}{f11}{f12}{left}{right}{up}{down}{home}{end}{pgup}{pgdn}{del}{ins}{bs}{capslock}{numlock}{printscreen}{pause} getkeystates() ; ifinstring errorlevel, endkey ; collectedtext .= (collectedtext =="" ? "" : " + " ) . substr(errorlevel, 8) if singlekey { singlekeytext= if (singlekey==chr(27)) singlekeytext=esc else if (singlekey==chr(32)) singlekeytext=space if (getkeystate("lcontrol", "p") || getkeystate("rcontrol", "p")) { if (singlekey==chr(10) && enterpressed) singlekeytext=enter else if (singlekey >= chr(1) && singlekey <= chr(26)) ; with "m" in input, ctrl-a through ctrl-z correspond to chr(1) through chr(26) singlekeytext := chr(asc("a")-1+asc(singlekey)) } else { if (singlekey==chr(10)) singlekeytext=enter } if not singlekeytext singlekeytext:=singlekey showkeys(keystates . singlekeytext) ; . (mousestate ? "`n" . mousestate : "") enterpressed=0 gosub clearmousestate } else { showkeys(substr(keystates, 1, -3) . (mousestate ? " + " . mousestate : "")) } settimer tooltipoff, % -idledelay } rwin:: exitapp ~*enter:: enterpressed=1 return ~*lbutton:: ~*rbutton:: ~*mbutton:: ~*xbutton1:: ~*xbutton2:: mousestate := "mouse " . substr(a_thishotkey, 3) . " pressed" mousetooltip() return ~*wheeldown:: ~*wheelup:: ~*wheelleft:: ~*wheelright:: mousestate := "mouse " . substr(a_thishotkey, 3) mousetooltip() return ~*lbutton up:: ~*rbutton up:: ~*mbutton up:: ~*xbutton1 up:: ~*xbutton2 up:: ; msgbox %a_priorhotkey%`n%a_thishotkey% if (a_priorhotkey == substr(a_thishotkey, 1, -3) && a_timesincepriorhotkey < 200) { clickcount++ suffix := " clicked " . clickcount . "x" } else { clickcount:=0 suffix := " released" } mousestate := "mouse " . substr(a_thishotkey, 3, -3) . suffix mousetooltip() return mousetooltip(){ getkeystates() showkeys(keystates . mousestate) settimer clearmousestate, % -idledelay settimer tooltipoff, % -idledelay } clearmousestate: mousestate= clickcount=0 return tooltipoff: if largedisplay gui hide else tooltip return getkeystates() { keystates := "" . ( getkeystate("lcontrol", "p") ? "lcontrol + " : "" ) . ( getkeystate("rcontrol", "p") ? "rcontrol + " : "" ) . ( getkeystate("lalt", "p") ? "lalt + " : "" ) . ( getkeystate("ralt", "p") ? "ralt + " : "" ) . ( getkeystate("lshift", "p") ? "lshift + " : "" ) . ( getkeystate("rshift", "p") ? "rshift + " : "" ) . ( getkeystate("lwin", "p") ? "lwin + " : "" ) . ( getkeystate("appskey", "p") ? "appskey + " : "" ) . ( getkeystate("f1", "p") ? "f1 + " : "" ) . ( getkeystate("f2", "p") ? "f2 + " : "" ) . ( getkeystate("f3", "p") ? "f3 + " : "" ) . ( getkeystate("f4", "p") ? "f4 + " : "" ) . ( getkeystate("f5", "p") ? "f5 + " : "" ) . ( getkeystate("f6", "p") ? "f6 + " : "" ) . ( getkeystate("f7", "p") ? "f7 + " : "" ) . ( getkeystate("f8", "p") ? "f8 + " : "" ) . ( getkeystate("f9", "p") ? "f9 + " : "" ) . ( getkeystate("f10", "p") ? "f10 + " : "" ) . ( getkeystate("f11", "p") ? "f11 + " : "" ) . ( getkeystate("f12", "p") ? "f12 + " : "" ) . ( getkeystate("left", "p") ? "left + " : "" ) . ( getkeystate("right", "p") ? "right + " : "" ) . ( getkeystate("up", "p") ? "up + " : "" ) . ( getkeystate("down", "p") ? "down + " : "" ) . ( getkeystate("home", "p") ? "home + " : "" ) . ( getkeystate("end", "p") ? "end + " : "" )x . ( getkeystate("pgup", "p") ? "pgup + " : "" ) . ( getkeystate("pgdn", "p") ? "pgdn + " : "" ) . ( getkeystate("del", "p") ? "del + " : "" ) . ( getkeystate("ins", "p") ? "ins + " : "" ) . ( getkeystate("bs", "p") ? "bs + " : "" ) . ( getkeystate("capslock", "p") ? "capslock + " : "" ) . ( getkeystate("numlock", "p") ? "numlock + " : "" ) . ( getkeystate("printscreen", "p") ? "printscreen + " : "" ) . ( getkeystate("pause", "p") ? "pause + " : "" ) } showkeys(text) { if largedisplay { global blkosdctrlname, blkosdctrlname2, monitorleft, monitorright, monitorbottom, monitortop, guix, guiy, guih coordmode mouse, screen mousegetpos mousex, mousey if ((!guiy) || (mousex >= monitorleft && mousex <= monitorright && mousey >= guiy && mousey <= (guiy+guih)) ) { if (mousey < (monitortop + (monitorbottom - monitortop) / 2) ) guiy := monitorbottom - (monitorbottom - monitortop) * 0.2 else guiy := monitortop + (monitorbottom - monitortop) * 0.2 } guicontrol text, blkosdctrlname, %text% guicontrol text, blkosdctrlname2, %text% gui, show, x%guix% y%guiy% noactivate } else { tooltip % text } }