Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для madmasles

Ветеран


Сообщения: 812
Благодарности: 353

Профиль | Отправить PM | Цитировать


Цитата 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

Отправлено: 17:56, 25-07-2011 | #4