OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: JasonO on 27 Mar 2011, 20:17:03

Title: Detecting left Mouse Click without a weapon
Post by: JasonO on 27 Mar 2011, 20:17:03
Hi,

I would like to detect when a left-mouse button is clicked. I thought about the display handlers (displayAddEventHandler) however the scope on those related to mouse clicks (onMouseButtonDown / onMouseButtonUp / onMouseButtonClick / onMouseButtonDblClick) are limited to controls and control elements only it seems. The only one that works on a display seems to be KeyDown and KeyUp.

So I can't see a workaround. None of the mouse buttons are detected as keys.. and thats pretty much the only work around I've attempted.

I know I could create some kind of blank weapon and use a fired eventhandler, however I don't really want to do this as it may interfer with the weapons the person already has.

Does anyone have any ideas? :/

Cheers,
Jason
Title: Re: Detecting left Mouse Click without a weapon
Post by: Denisko-Redisko on 29 Mar 2011, 10:01:26
Quote
however the scope on those related to mouse clicks (onMouseButtonDown / onMouseButtonUp / onMouseButtonClick / onMouseButtonDblClick) are limited to controls and control elements only it seems
Code: [Select]
findDisplay 46 displayAddEventHandler ["MouseButtonDown", "hint str _this"]This example works just fine.