Собственно, я могу создать событие, что конкретный игрок нажимает конкретную кнопку (например, Q):
call BlzTriggerRegisterPlayerKeyEvent( gg_trg_oskey, Player(0), OSKEY_Q, 0, true )
А как можно реализовать универсальное событие, чтобы потом опрашивать, какая именно кнопка была нажата?
Например, с помощью BlzGetTriggerPlayerKey
Заранее благодарю.
call BlzTriggerRegisterPlayerKeyEvent( gg_trg_oskey, Player(0), OSKEY_Q, 0, true )
А как можно реализовать универсальное событие, чтобы потом опрашивать, какая именно кнопка была нажата?
Например, с помощью BlzGetTriggerPlayerKey
Заранее благодарю.
Принятый ответ
BlzTriggerRegisterPlayerKeyEvent - вешает событие на триггер
BlzGetTriggerPlayerKey - возвращает нажатую кнопку с события
BlzGetTriggerPlayerKey - возвращает нажатую кнопку с события
возможно вешать 100500 событий на один триггер не лучшая идея, но вроде бы только так
т.е. циклом развешивать все нужные кнопки на каждого игрока и всё
потом через массивы добавить определение что за кнопка была нажата
т.е. циклом развешивать все нужные кнопки на каждого игрока и всё
потом через массивы добавить определение что за кнопка была нажата
раскрыть
constant oskeytype OSKEY_BACKSPACE = ConvertOsKeyType(8)
constant oskeytype OSKEY_TAB = ConvertOsKeyType(9)
constant oskeytype OSKEY_CLEAR = ConvertOsKeyType(12)
constant oskeytype OSKEY_RETURN = ConvertOsKeyType(13)
constant oskeytype OSKEY_SHIFT = ConvertOsKeyType(16)
constant oskeytype OSKEY_CONTROL = ConvertOsKeyType(17)
constant oskeytype OSKEY_ALT = ConvertOsKeyType(18)
constant oskeytype OSKEY_PAUSE = ConvertOsKeyType(19)
constant oskeytype OSKEY_CAPSLOCK = ConvertOsKeyType(20)
constant oskeytype OSKEY_KANA = ConvertOsKeyType(21)
constant oskeytype OSKEY_HANGUL = ConvertOsKeyType(21)
constant oskeytype OSKEY_JUNJA = ConvertOsKeyType(23)
constant oskeytype OSKEY_FINAL = ConvertOsKeyType(24)
constant oskeytype OSKEY_HANJA = ConvertOsKeyType(25)
constant oskeytype OSKEY_KANJI = ConvertOsKeyType(25)
constant oskeytype OSKEY_ESCAPE = ConvertOsKeyType(27)
constant oskeytype OSKEY_CONVERT = ConvertOsKeyType(28)
constant oskeytype OSKEY_NONCONVERT = ConvertOsKeyType(29)
constant oskeytype OSKEY_ACCEPT = ConvertOsKeyType(30)
constant oskeytype OSKEY_MODECHANGE = ConvertOsKeyType(31)
constant oskeytype OSKEY_SPACE = ConvertOsKeyType(32)
constant oskeytype OSKEY_PAGEUP = ConvertOsKeyType(33)
constant oskeytype OSKEY_PAGEDOWN = ConvertOsKeyType(34)
constant oskeytype OSKEY_END = ConvertOsKeyType(35)
constant oskeytype OSKEY_HOME = ConvertOsKeyType(36)
constant oskeytype OSKEY_LEFT = ConvertOsKeyType(37)
constant oskeytype OSKEY_UP = ConvertOsKeyType(38)
constant oskeytype OSKEY_RIGHT = ConvertOsKeyType(39)
constant oskeytype OSKEY_DOWN = ConvertOsKeyType(40)
constant oskeytype OSKEY_SELECT = ConvertOsKeyType(41)
constant oskeytype OSKEY_PRINT = ConvertOsKeyType(42)
constant oskeytype OSKEY_EXECUTE = ConvertOsKeyType(43)
constant oskeytype OSKEY_PRINTSCREEN = ConvertOsKeyType(44)
constant oskeytype OSKEY_INSERT = ConvertOsKeyType(45)
constant oskeytype OSKEY_DELETE = ConvertOsKeyType(46)
constant oskeytype OSKEY_HELP = ConvertOsKeyType(47)
constant oskeytype OSKEY_0 = ConvertOsKeyType(48)
constant oskeytype OSKEY_1 = ConvertOsKeyType(49)
constant oskeytype OSKEY_2 = ConvertOsKeyType(50)
constant oskeytype OSKEY_3 = ConvertOsKeyType(51)
constant oskeytype OSKEY_4 = ConvertOsKeyType(52)
constant oskeytype OSKEY_5 = ConvertOsKeyType(53)
constant oskeytype OSKEY_6 = ConvertOsKeyType(54)
constant oskeytype OSKEY_7 = ConvertOsKeyType(55)
constant oskeytype OSKEY_8 = ConvertOsKeyType(56)
constant oskeytype OSKEY_9 = ConvertOsKeyType(57)
constant oskeytype OSKEY_A = ConvertOsKeyType(65)
constant oskeytype OSKEY_B = ConvertOsKeyType(66)
constant oskeytype OSKEY_C = ConvertOsKeyType(67)
constant oskeytype OSKEY_D = ConvertOsKeyType(68)
constant oskeytype OSKEY_E = ConvertOsKeyType(69)
constant oskeytype OSKEY_F = ConvertOsKeyType(70)
constant oskeytype OSKEY_G = ConvertOsKeyType(71)
constant oskeytype OSKEY_H = ConvertOsKeyType(72)
constant oskeytype OSKEY_I = ConvertOsKeyType(73)
constant oskeytype OSKEY_J = ConvertOsKeyType(74)
constant oskeytype OSKEY_K = ConvertOsKeyType(75)
constant oskeytype OSKEY_L = ConvertOsKeyType(76)
constant oskeytype OSKEY_M = ConvertOsKeyType(77)
constant oskeytype OSKEY_N = ConvertOsKeyType(78)
constant oskeytype OSKEY_O = ConvertOsKeyType(79)
constant oskeytype OSKEY_P = ConvertOsKeyType(80)
constant oskeytype OSKEY_Q = ConvertOsKeyType(81)
constant oskeytype OSKEY_R = ConvertOsKeyType(82)
constant oskeytype OSKEY_S = ConvertOsKeyType(83)
constant oskeytype OSKEY_T = ConvertOsKeyType(84)
constant oskeytype OSKEY_U = ConvertOsKeyType(85)
constant oskeytype OSKEY_V = ConvertOsKeyType(86)
constant oskeytype OSKEY_W = ConvertOsKeyType(87)
constant oskeytype OSKEY_X = ConvertOsKeyType(88)
constant oskeytype OSKEY_Y = ConvertOsKeyType(89)
constant oskeytype OSKEY_Z = ConvertOsKeyType(90)
constant oskeytype OSKEY_LMETA = ConvertOsKeyType(91)
constant oskeytype OSKEY_RMETA = ConvertOsKeyType(92)
constant oskeytype OSKEY_APPS = ConvertOsKeyType(93)
constant oskeytype OSKEY_SLEEP = ConvertOsKeyType(95)
constant oskeytype OSKEY_NUMPAD0 = ConvertOsKeyType(96)
constant oskeytype OSKEY_NUMPAD1 = ConvertOsKeyType(97)
constant oskeytype OSKEY_NUMPAD2 = ConvertOsKeyType(98)
constant oskeytype OSKEY_NUMPAD3 = ConvertOsKeyType(99)
constant oskeytype OSKEY_NUMPAD4 = ConvertOsKeyType(100)
constant oskeytype OSKEY_NUMPAD5 = ConvertOsKeyType(101)
constant oskeytype OSKEY_NUMPAD6 = ConvertOsKeyType(102)
constant oskeytype OSKEY_NUMPAD7 = ConvertOsKeyType(103)
constant oskeytype OSKEY_NUMPAD8 = ConvertOsKeyType(104)
constant oskeytype OSKEY_NUMPAD9 = ConvertOsKeyType(105)
constant oskeytype OSKEY_MULTIPLY = ConvertOsKeyType(106)
constant oskeytype OSKEY_ADD = ConvertOsKeyType(107)
constant oskeytype OSKEY_SEPARATOR = ConvertOsKeyType(108)
constant oskeytype OSKEY_SUBTRACT = ConvertOsKeyType(109)
constant oskeytype OSKEY_DECIMAL = ConvertOsKeyType(110)
constant oskeytype OSKEY_DIVIDE = ConvertOsKeyType(111)
constant oskeytype OSKEY_F1 = ConvertOsKeyType(112)
constant oskeytype OSKEY_F2 = ConvertOsKeyType(113)
constant oskeytype OSKEY_F3 = ConvertOsKeyType(114)
constant oskeytype OSKEY_F4 = ConvertOsKeyType(115)
constant oskeytype OSKEY_F5 = ConvertOsKeyType(116)
constant oskeytype OSKEY_F6 = ConvertOsKeyType(117)
constant oskeytype OSKEY_F7 = ConvertOsKeyType(118)
constant oskeytype OSKEY_F8 = ConvertOsKeyType(119)
constant oskeytype OSKEY_F9 = ConvertOsKeyType(120)
constant oskeytype OSKEY_F10 = ConvertOsKeyType(121)
constant oskeytype OSKEY_F11 = ConvertOsKeyType(122)
constant oskeytype OSKEY_F12 = ConvertOsKeyType(123)
constant oskeytype OSKEY_F13 = ConvertOsKeyType(124)
constant oskeytype OSKEY_F14 = ConvertOsKeyType(125)
constant oskeytype OSKEY_F15 = ConvertOsKeyType(126)
constant oskeytype OSKEY_F16 = ConvertOsKeyType(127)
constant oskeytype OSKEY_F17 = ConvertOsKeyType(128)
constant oskeytype OSKEY_F18 = ConvertOsKeyType(129)
constant oskeytype OSKEY_F19 = ConvertOsKeyType(130)
constant oskeytype OSKEY_F20 = ConvertOsKeyType(131)
constant oskeytype OSKEY_F21 = ConvertOsKeyType(132)
constant oskeytype OSKEY_F22 = ConvertOsKeyType(133)
constant oskeytype OSKEY_F23 = ConvertOsKeyType(134)
constant oskeytype OSKEY_F24 = ConvertOsKeyType(135)
constant oskeytype OSKEY_NUMLOCK = ConvertOsKeyType(144)
constant oskeytype OSKEY_SCROLLLOCK = ConvertOsKeyType(145)
constant oskeytype OSKEY_OEM_NEC_EQUAL = ConvertOsKeyType(146)
constant oskeytype OSKEY_OEM_FJ_JISHO = ConvertOsKeyType(146)
constant oskeytype OSKEY_OEM_FJ_MASSHOU = ConvertOsKeyType(147)
constant oskeytype OSKEY_OEM_FJ_TOUROKU = ConvertOsKeyType(148)
constant oskeytype OSKEY_OEM_FJ_LOYA = ConvertOsKeyType(149)
constant oskeytype OSKEY_OEM_FJ_ROYA = ConvertOsKeyType(150)
constant oskeytype OSKEY_LSHIFT = ConvertOsKeyType(160)
constant oskeytype OSKEY_RSHIFT = ConvertOsKeyType(161)
constant oskeytype OSKEY_LCONTROL = ConvertOsKeyType(162)
constant oskeytype OSKEY_RCONTROL = ConvertOsKeyType(163)
constant oskeytype OSKEY_LALT = ConvertOsKeyType(164)
constant oskeytype OSKEY_RALT = ConvertOsKeyType(165)
constant oskeytype OSKEY_BROWSER_BACK = ConvertOsKeyType(166)
constant oskeytype OSKEY_BROWSER_FORWARD = ConvertOsKeyType(167)
constant oskeytype OSKEY_BROWSER_REFRESH = ConvertOsKeyType(168)
constant oskeytype OSKEY_BROWSER_STOP = ConvertOsKeyType(169)
constant oskeytype OSKEY_BROWSER_SEARCH = ConvertOsKeyType(170)
constant oskeytype OSKEY_BROWSER_FAVORITES = ConvertOsKeyType(171)
constant oskeytype OSKEY_BROWSER_HOME = ConvertOsKeyType(172)
constant oskeytype OSKEY_VOLUME_MUTE = ConvertOsKeyType(173)
constant oskeytype OSKEY_VOLUME_DOWN = ConvertOsKeyType(174)
constant oskeytype OSKEY_VOLUME_UP = ConvertOsKeyType(175)
constant oskeytype OSKEY_MEDIA_NEXT_TRACK = ConvertOsKeyType(176)
constant oskeytype OSKEY_MEDIA_PREV_TRACK = ConvertOsKeyType(177)
constant oskeytype OSKEY_MEDIA_STOP = ConvertOsKeyType(178)
constant oskeytype OSKEY_MEDIA_PLAY_PAUSE = ConvertOsKeyType(179)
constant oskeytype OSKEY_LAUNCH_MAIL = ConvertOsKeyType(180)
constant oskeytype OSKEY_LAUNCH_MEDIA_SELECT = ConvertOsKeyType(181)
constant oskeytype OSKEY_LAUNCH_APP1 = ConvertOsKeyType(182)
constant oskeytype OSKEY_LAUNCH_APP2 = ConvertOsKeyType(183)
constant oskeytype OSKEY_OEM_1 = ConvertOsKeyType(186)
constant oskeytype OSKEY_OEM_PLUS = ConvertOsKeyType(187)
constant oskeytype OSKEY_OEM_COMMA = ConvertOsKeyType(188)
constant oskeytype OSKEY_OEM_MINUS = ConvertOsKeyType(189)
constant oskeytype OSKEY_OEM_PERIOD = ConvertOsKeyType(190)
constant oskeytype OSKEY_OEM_2 = ConvertOsKeyType(191)
constant oskeytype OSKEY_OEM_3 = ConvertOsKeyType(192)
constant oskeytype OSKEY_OEM_4 = ConvertOsKeyType(219)
constant oskeytype OSKEY_OEM_5 = ConvertOsKeyType(220)
constant oskeytype OSKEY_OEM_6 = ConvertOsKeyType(221)
constant oskeytype OSKEY_OEM_7 = ConvertOsKeyType(222)
constant oskeytype OSKEY_OEM_8 = ConvertOsKeyType(223)
constant oskeytype OSKEY_OEM_AX = ConvertOsKeyType(225)
constant oskeytype OSKEY_OEM_102 = ConvertOsKeyType(226)
constant oskeytype OSKEY_ICO_HELP = ConvertOsKeyType(227)
constant oskeytype OSKEY_ICO_00 = ConvertOsKeyType(228)
constant oskeytype OSKEY_PROCESSKEY = ConvertOsKeyType(229)
constant oskeytype OSKEY_ICO_CLEAR = ConvertOsKeyType(230)
constant oskeytype OSKEY_PACKET = ConvertOsKeyType(231)
constant oskeytype OSKEY_OEM_RESET = ConvertOsKeyType(233)
constant oskeytype OSKEY_OEM_JUMP = ConvertOsKeyType(234)
constant oskeytype OSKEY_OEM_PA1 = ConvertOsKeyType(235)
constant oskeytype OSKEY_OEM_PA2 = ConvertOsKeyType(236)
constant oskeytype OSKEY_OEM_PA3 = ConvertOsKeyType(237)
constant oskeytype OSKEY_OEM_WSCTRL = ConvertOsKeyType(238)
constant oskeytype OSKEY_OEM_CUSEL = ConvertOsKeyType(239)
constant oskeytype OSKEY_OEM_ATTN = ConvertOsKeyType(240)
constant oskeytype OSKEY_OEM_FINISH = ConvertOsKeyType(241)
constant oskeytype OSKEY_OEM_COPY = ConvertOsKeyType(242)
constant oskeytype OSKEY_OEM_AUTO = ConvertOsKeyType(243)
constant oskeytype OSKEY_OEM_ENLW = ConvertOsKeyType(244)
constant oskeytype OSKEY_OEM_BACKTAB = ConvertOsKeyType(245)
constant oskeytype OSKEY_ATTN = ConvertOsKeyType(246)
constant oskeytype OSKEY_CRSEL = ConvertOsKeyType(247)
constant oskeytype OSKEY_EXSEL = ConvertOsKeyType(248)
constant oskeytype OSKEY_EREOF = ConvertOsKeyType(249)
constant oskeytype OSKEY_PLAY = ConvertOsKeyType(250)
constant oskeytype OSKEY_ZOOM = ConvertOsKeyType(251)
constant oskeytype OSKEY_NONAME = ConvertOsKeyType(252)
constant oskeytype OSKEY_PA1 = ConvertOsKeyType(253)
constant oskeytype OSKEY_OEM_CLEAR = ConvertOsKeyType(254)
`
ОЖИДАНИЕ РЕКЛАМЫ...
Чтобы оставить комментарий, пожалуйста, войдите на сайт.
BlzGetTriggerPlayerKey - возвращает нажатую кнопку с события
т.е. циклом развешивать все нужные кнопки на каждого игрока и всё
потом через массивы добавить определение что за кнопка была нажата
Отредактирован Koladik