Цитата TERMINAL:
а как сделать чтобы через ToolTip нажатые клавиши выводились »
|
Попробуйте так:
Код:
#include <IsPressedEx.au3>
#include <WinAPIEx.au3>;http://autoit-script.ru/index.php/topic,47.0.html
Opt('MustDeclareVars', 1)
HotKeySet('{Esc}', '_Quit')
Global $fTimeOld, $fTime, $sPressed, $iRet, $iTime
AdlibRegister('_Show', 1000)
$iTime = TimerInit()
While 1
$iRet = _IsPressedEx('[:ALLKEYS:]')
If $iRet Then
$fTime = Not $fTime
If StringInStr(__KeyGetType($iRet, 0), 'mouse') Then
$sPressed = 'Mouse (' & __KeyGetType($iRet, 0) & ')'
Else
$sPressed = 'Key (' & __KeyGetType($iRet, 0) & ')'
EndIf
EndIf
If $fTimeOld <> $fTime Then
$fTimeOld = $fTime
$iTime = TimerInit()
EndIf
Sleep(10)
WEnd
Func _Show()
If $sPressed Then
ToolTip('Прошло после последнего нажатия: ' & _WinAPI_StrFromTimeInterval(TimerDiff($iTime)) & @LF & 'Нажимали: ' & _
$sPressed & @LF & @LF & 'Совсем ничего не делали: ' & _WinAPI_StrFromTimeInterval(_WinAPI_GetIdleTime()), 0, 0)
Else
ToolTip('Ничего не нажимали: ' & _WinAPI_StrFromTimeInterval(TimerDiff($iTime)) & @LF & @LF & _
'Совсем ничего не делали: ' & _WinAPI_StrFromTimeInterval(_WinAPI_GetIdleTime()), 0, 0)
EndIf
EndFunc ;==>_Show
Func _Quit()
Exit
EndFunc ;==>_Quit