Author Topic: mouseinfo()  (Read 80 times)

0 Members and 1 Guest are viewing this topic.

ABer

  • Administrator
  • Hero Member
  • *****
  • Posts: 692
    • View Profile
mouseinfo()
« on: October 30, 2022, 12:45:30 PM »
Hi there - I'm a bit confused about the mouseinfo() function. I want to limit a mousedown event to the left button, but I'm not sure how to do this.

mousedown

Syntax: mousedown(label);

Action: creates an eventhandler for the mousedown event. The global vars mousex and mousey will hold the position of the mouse and mouseinfo will hold info about the event.
'mouseinfo' is a bitfield where bit
0 = leftbutton
1 = rightbutton
2 = middlebutton
3 = shift
4 = alt
5 = control
6 = middle
7 = doubleclick

Jean

  • Administrator
  • Hero Member
  • *****
  • Posts: 735
    • View Profile
Re: mouseinfo()
« Reply #1 on: October 30, 2022, 12:56:30 PM »
Code: [Select]
:mouseDown;
  if (isbit(mouseinfo, 0) = 1)
   popup(etc
  return;

or if (isbit(mouseinfo, 1) = 1) for the right button etc.
Greetings from Groningen Netherlands <)))><.`.><(((>

ABer

  • Administrator
  • Hero Member
  • *****
  • Posts: 692
    • View Profile
Re: mouseinfo()
« Reply #2 on: October 30, 2022, 01:08:01 PM »
Thanks Jean - that's helpful. ed