Что нового

Не "блокируется" HotKey

zelich

Новичок
Сообщения
136
Репутация
0
Есть скрипт:
Код:
#include <GuiConstants.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
TraySetToolTip('Revit 3_06/09')

HotKeySet('+{Esc}', '_Exit')

HotKeySet('{`}', 'ZoomE')   ;~ Зум
HotKeySet('{F1}', 'Empty')        ;~ Заглушка
HotKeySet('^{F1}', 'TestScrip')

HotKeySet('{F4}', 'Remem')


HotKeySet('^{w}', 'CtrlW')  ;~ Блок Ctrl+W

Global  $zX, $zY, $ReSiteCommnd, $DupCommand, $DelCopyCommand, $timesZE
$r = 0
$r2 =0
$active = 0
;~ $Lock = False
;~ $Y = -1

;~ ***************************************************************************************aaaaa
Global $Send[3] = ["{APPSKEY}{UP 7}{ENTER}{RIGHT}{BACKSPACE 7}сайт{ENTER}", "{APPSKEY}{UP 7}{ENTER}{RIGHT}{BACKSPACE 7}сайт{ENTER}", 0]

Global $hGUI = GUICreate("Выражение 3:", 400, 150)
Global $aRadio[3][2] = [[GUICtrlCreateRadio("  {APPSKEY}{UP 7}{ENTER}{RIGHT}{BACKSPACE 7}сайт{ENTER}", 10, 10, 380, 20), "aaaaa"]]
GUICtrlSetState(-1, $GUI_CHECKED)
$aRadio[1][0] = GUICtrlCreateRadio("  {APPSKEY}{UP 7}{ENTER}{RIGHT}{BACKSPACE 7}ЦП{ENTER}", 10, 40, 380, 20)
$aRadio[1][1] = "{APPSKEY}{UP 7}{ENTER}{RIGHT}{BACKSPACE 7}ЦП{ENTER}"
$aRadio[2][0] = GUICtrlCreateRadio("", 10, 70, 15, 15)
$aRadio[2][1] = "{APPSKEY}{UP 7}{ENTER}{RIGHT}"
$Input = GUICtrlCreateInput($aRadio[2][1], 30, 68, 330, 20)
GUICtrlSetState(-1, $GUI_DISABLE)
$iOK_Button = GUICtrlCreateButton("OK", 20, 100, 80, 20)
$iCancel_Button = GUICtrlCreateButton("Отмена", 110, 100, 80, 20)
GUISetState(@SW_HIDE, $hGUI)
;~ ***************************************************************************************

$GUI = GUICreate("", 60, 60, 1890, 42, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_TRANSPARENT, $WS_EX_LAYERED))
GUISetBkColor(0x00B510)
_WinAPI_SetLayeredWindowAttributes($GUI, 0x00B510, 0, $LWA_COLORKEY)
GUICtrlCreateLabel("•", 0, 0, 30, 30, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetColor(-1, 0x527887)
GUICtrlSetFont(-1, 40)


GUISetState()

While 1
    Sleep(10)
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $iCancel_Button
            $Send[1] = $Send[0]
            ControlCommand($hGUI,"", $aRadio[$Send[2]][0], "Check", "")
            GUISetState(@SW_HIDE, $hGUI)
        Case $aRadio[0][0], $aRadio[1][0]
            GUICtrlSetState($Input, $GUI_DISABLE)
        Case $aRadio[2][0]
            GUICtrlSetState($Input, $GUI_ENABLE)
         Case $iOK_Button
            For $nN = 0 To 2
                If GUICtrlRead($aRadio[$nN][0]) = $GUI_CHECKED Then
                    $Send[1] = ($nN = 2) ? (GUICtrlRead($Input)) : $aRadio[$nN][1]
                    $Send[0] = $Send[1]
                    $Send[2] = $nN
                    ExitLoop
                EndIf
            Next
            GUISetState(@SW_HIDE, $hGUI)
    EndSwitch
;~          *************************************************
   If $r2 = 0 Then
      Start()
      $r2 = 1
   EndIf
WEnd

Func Start()
   $ReSiteCommnd =FileReadLine('Revit_Text.txt', 1)
   $DelCopyCommand = FileReadLine('Revit_Text.txt', 2)
   $DupCommand = FileReadLine('Revit_Text.txt', 3)
   $timesZE = FileReadLine('Revit_Text.txt', 4)

   MsgBox(0, "Содержимое 4-x строк", $ReSiteCommnd&@CRLF&$DelCopyCommand&@CRLF&$DupCommand&@CRLF&$timesZE,2)
EndFunc


Func CtrlW()

      Beep(1,100)

EndFunc

Func FirstText ()
   $hFile = FileOpen('Revit_Text.txt', 2)
   If $hFile = -1 Then
       MsgBox(4096, "Ошибка", "Невозможно открыть файл.")
       Exit
   EndIf
   If $r = 0 Then
      FileWrite($hFile, $ReSiteCommnd&@CRLF)
      FileWrite($hFile, $DelCopyCommand&@CRLF)
      FileWrite($hFile, $DupCommand&@CRLF)
      FileWrite($hFile, $timesZE)
      $r = 1
   EndIf
   FileClose($hFile)
EndFunc

Func _Exit()
   FirstText ()
   Exit
 EndFunc


Не могу понять почему Ctrl+W не срабатывает... Помогите/ подскажите пожалуйста
 

Glass4217

Осваивающий
Сообщения
270
Репутация
48
в данном случае "фигурные скобки" не нужны
Код:
HotKeySet('^w', 'CtrlW')  ;~ Блок Ctrl+
 
Последнее редактирование:
Верх