Middle mouse button
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Middle mouse button
There's a way to trap the middle mouse button (2) on OSX?
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Middle mouse button
In LiveCode mouseDown and mouseUp messages are accompanied by an argument which is the mouse button number, e.g.:
Code: Select all
on mouseDown pBtn
switch pBtn
case 1
DoNormalClickStuff
break
case 2
DoMiddleButtonStuff
break
case 3
DoRightClickStuff
break
end switch
end mouseUp
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Middle mouse button
Thank you Richard, but on OSX the middle button (case 2) is not trapped by the mouseDown handler.
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Middle mouse button
What model of mouse is it?paulclaude wrote:Thank you Richard, but on OSX the middle button (case 2) is not trapped by the mouseDown handler.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Middle mouse button
A Logitech M185. But I've tried also another mouse, with the same effect. I run OSX 10.11 (El Capitan) with LC 7.1.1 (rc 2).
Re: Middle mouse button
Hi.
Is it possible that the Logitech mouse has to be configured so that the middle button is properly designated? I have a multi-button Logitech, and a control panel is required to set all the gadgets on it.
Craig Newman
Is it possible that the Logitech mouse has to be configured so that the middle button is properly designated? I have a multi-button Logitech, and a control panel is required to set all the gadgets on it.
Craig Newman
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Middle mouse button
I've configured my Logitech mouse assigning Midle Click function to the middle button, and it works perfectly on every app, Finder included.
From the Livecode dictionary:
Parameters:
The buttonNumber specifies which mouse button to check:
* 1 is the mouse button on Mac OS systems and the left button on Windows and Unix systems.
* 2 is the middle button on Unix systems.
* 3 is the right button on Windows and Unix systems and Control-click on Mac OS systems.
It talk about Unix systems only...
From the Livecode dictionary:
Parameters:
The buttonNumber specifies which mouse button to check:
* 1 is the mouse button on Mac OS systems and the left button on Windows and Unix systems.
* 2 is the middle button on Unix systems.
* 3 is the right button on Windows and Unix systems and Control-click on Mac OS systems.
It talk about Unix systems only...
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Middle mouse button
I haven't used that model, but in the past I have successfully used a Logitech mouse with LC. The scroll wheel sends a rawyKey down message, equivalent to scrolling messages from the keyboard. But clicking the scroll wheel has produced a 2 argument to mouseup.
If you're not seeing that perhaps the Cocoa change introduced an issue that needs resolving. You may want to file a bug report for that:
http://quality.livecode.com/
If you're not seeing that perhaps the Cocoa change introduced an issue that needs resolving. You may want to file a bug report for that:
http://quality.livecode.com/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Middle mouse button
I've found something strange. Disabling all mouse external extensions, the following code works as expected, giving the button number for all buttons:
but this, give the button "down" only for mouse button 1 and 3:
so I can't trap mouse button 2 in an unlocked field, 'cause "if the Browse tool is being used, and you click an unlocked field with mouse button 1 or 2, no mouseDown message is sent".
Code: Select all
on mouseDown pBtn
put pBtn
end mouseDown
Code: Select all
on mouseMove
put mouse(1)&&mouse(2)&&mouse(3)
end mouseMove