getPushedKeys.uws while 1 pushed =getPushedKeys() keys ="キーを押すと、下にキーコードが表示されます。alt+f2で終了<#CR>" for key in pushed keys =keys + key + "," next fukidasi( keys ) wend endif
function getPushedKeys( skipToggles=true ) def_dll GetKeyboardState( var byte[] ):bool:user32.dll
if skipToggles //トグル系のキーは何もしなくても押されたことになるのでデフォルトで排除 last =239 else last =255
buff =safearray( 0,last ) GetKeyboardState( buff ) for i =0 to last PushedKey =buff[ i ] if PushedKey > 127 result =result + i + "," endif next //余分なコンマを外す result =copy(result, 1, length( result )-1) result =split( result, "," ) fend