Function __getKeyEvt

au3Irr2

au3Irr2 Function Reference

__getKeyEvt

helper function: returns value of $i_Element inside a keyEvent-structure.

#Include <au3Irrlicht2.au3>
__getKeyEvt($p_KeyEvent, $i_Element = $EVT_KEY_IKEY)

 

Parameters

$p_KeyEvent A pointer as returned from _IrrReadKeyEvent.
$i_Element [optional] Event type to return:
$EVT_KEY_IKEY - ID of pressed key (see remarks).
$EVT_KEY_IDIRECTION - Direction value - can be either $IRR_KEY_DOWN or $IRR_KEY_UP
$EVT_KEY_IFLAGS - Bits are set in this parameter to specify whether the shift or control key was keydown at the time the key action occured.

 

Return Value

Success: Value of selected event element.

 

Remarks

$p_KeyEvent is a pointer as returned from _IrrReadKeyEvent.

Key code table for $EVT_KEY_IKEY:
$KEY_LBUTTON Left mouse button $KEY_RBUTTON Right mouse button
$KEY_CANCEL Control-break processing $KEY_MBUTTON Middle mouse button (three-button mouse)
$KEY_XBUTTON1 Windows 2000/XP: X1 mouse button $KEY_XBUTTON2 Windows 2000/XP: X2 mouse button
$KEY_BACK BACKSPACE key $KEY_TAB Tab key
$KEY_CLEAR Clear key $KEY_RETURN ENTER key
$KEY_SHIFT SHIFT key $KEY_CONTROL CTRL key
$KEY_MENU ALT key $KEY_PAUSE PAUSE key
$KEY_CAPITAL CAPS Lock key $KEY_KANA IME Kana mode
$KEY_HANGUEL IME Hanguel mode (maintained For compatibility use KEY_HANGUL) $KEY_HANGUL IME Hangul mode
$KEY_JUNJA IME Junja mode $KEY_FINAL IME final mode
$KEY_HANJA IME Hanja mode $KEY_KANJI IME Kanji mode
$KEY_ESCAPE ESC key $KEY_CONVERT IME convert
$KEY_NONCONVERT IME nonconvert $KEY_ACCEPT IME accept
$KEY_MODECHANGE IME mode change request $KEY_SPACE SPACEBAR
$KEY_PRIOR PAGE UP key $KEY_NEXT PAGE DOWN key
$KEY_END End key $KEY_HOME HOME key
$KEY_LEFT Left ARROW key $KEY_UP UP ARROW key
$KEY_RIGHT Right ARROW key $KEY_DOWN DOWN ARROW key
$KEY_SELECT Select key $KEY_PRINT Print key
$KEY_EXECUT EXECUTE key $KEY_SNAPSHOT Print Screen key
$KEY_INSERT INS key $KEY_DELETE DEL key
$KEY_HELP HELP key $KEY_KEY_0 0 key
$KEY_KEY_1 1 key ... ...
$KEY_KEY_9 9 key $KEY_KEY_A A key
$KEY_KEY_B B key ... ...
$KEY_KEY_Z Z key $KEY_LWIN Left Win key (Microsoft® Natural® keyboard)
$KEY_RWIN Right Win key (Natural keyboard) $KEY_APPS Applications key (Natural keyboard)
$KEY_SLEEP Computer Sleep key $KEY_NUMPAD0 Numeric keypad 0 key
$KEY_NUMPAD1 Numeric keypad 1 key ... ...
$KEY_NUMPAD9 Numeric keypad 9 key $KEY_MULTIPLY Multiply key
$KEY_ADD Add key $KEY_SEPARATOR Separator key
$KEY_SUBTRACT Subtract key $KEY_DECIMAL Decimal key
$KEY_DIVIDE Divide key $KEY_F1 F1 key
$KEY_F2 F2 key ... ...
$KEY_F24 F24 key $KEY_NUMLOCK NUM Lock key
$KEY_SCROLL SCROLL Lock key $KEY_LSHIFT Left SHIFT key
$KEY_RSHIFT Right SHIFT key $KEY_LCONTROL Left CONTROL key
$KEY_RCONTROL Right CONTROL key $KEY_LMENU Left MENU key
$KEY_RMENU Right MENU key $KEY_PLUS Plus Key (+)
$KEY_COMMA Comma Key (,) $KEY_MINUS Minus Key (-)
$KEY_PERIOD Period Key (.) $KEY_ATTN Attn key
$KEY_CRSEL CrSel key $KEY_EXSEL ExSel key
$KEY_EREOF Erase Eof key $KEY_PLAY Play key
$KEY_ZOOM Zoom key $KEY_PA1 PA1 key
$KEY_OEM_CLEAR Clear key $KEY_KEY_CODES_COUNT This Is Not a key but the amount of keycodes there are.

 

Related

_IrrReadKeyEvent, _IrrKeyEventAvailable

 

Example


#include "au3Irrlicht2.au3"

local $pKeyEvent

; enable event capturing:
_IrrStart($IRR_EDT_DIRECT3D9, 800, 600, $IRR_BITS_PER_PIXEL_32, _
            $IRR_WINDOWED, $IRR_NO_SHADOWS, $IRR_CAPTURE_EVENTS)

WHILE _IrrRunning()
    _IrrBeginScene(0, 0, 25)

        ; process all available key events and check for ESC:
       while _IrrKeyEventAvailable()
            $pKeyEvent = _IrrReadKeyEvent()
            if __getKeyEvt($pKeyEvent, $EVT_KEY_IKEY) = $KEY_ESCAPE then _IrrStop()
        WEnd

    _IrrEndScene()
WEND