Home   Help Search Login Register  

Author Topic: Detecting left Mouse Click without a weapon  (Read 2560 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Detecting left Mouse Click without a weapon
« 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

Offline Denisko-Redisko

  • Members
  • *
Re: Detecting left Mouse Click without a weapon
« Reply #1 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.
sorry for my english