au3Irr2 Function Reference
__getMouseEvthelper function: returns value of $i_Element inside a MouseEvent-structure.
#Include <au3Irrlicht2.au3>
__getMouseEvt($p_MouseEvent, $i_Element = $EVT_MOUSE_IACTION)
Parameters
$p_MouseEvent | A pointer as returned from _IrrReadMouseEvent. |
$i_Element | [optional] Event type to return: $EVT_MOUSE_IACTION - ID of mouse action (see remarks). $EVT_MOUSE_FDELTA - Amount of movement of the mouse wheel (> 0 means wheel up, < 0 means wheel down). $EVT_MOUSE_IX - Horizontal screen coordinate at which the event took place. $EVT_MOUSE_IY - Vertical screen coordinate at which the event took place. |
Return Value
Success: Value of selected event element.
Remarks
$p_MouseEvent is a pointer as returned from _IrrReadMouseEvent.Mouse actions table for $EVT_MOUSE_IACTION:
$IRR_EMIE_LMOUSE_PRESSED_DOWN | Left mouse button pressed |
$IRR_EMIE_RMOUSE_PRESSED_DOWN | Right mouse button pressed |
$IRR_EMIE_MMOUSE_PRESSED_DOWN | Middle mouse button pressed |
$IRR_EMIE_LMOUSE_LEFT_UP | Left mouse button released |
$IRR_EMIE_RMOUSE_LEFT_UP | Right mouse button released |
$IRR_EMIE_MMOUSE_LEFT_UP | Middle mouse button released |
$IRR_EMIE_MOUSE_MOVED | Mouse was moved horizontal and/or vertical |
$IRR_EMIE_MOUSE_WHEEL | Mouse wheel was moved up or down |
Related
_IrrReadMouseEvent, _IrrMouseEventAvailable
Example
#include "au3Irrlicht2.au3"
local $pMouseEvent
; 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 mouse events:
while _IrrMouseEventAvailable()
$pMouseEvent = _IrrReadMouseEvent()
; check for mousewheel event, report up or down movement inside this window title:
if __getMouseEvt($pMouseEvent, $EVT_MOUSE_IACTION) = $IRR_EMIE_MOUSE_WHEEL then
if __getMouseEvt($pMouseEvent, $EVT_MOUSE_FDELTA) > 0 Then
_IrrSetWindowCaption("Mousewheel up")
Else
_IrrSetWindowCaption("Mousewheel down")
EndIf
endif
wend
_IrrEndScene()
WEND