on mouseUp pButtonNumber "VS" on mouseUp. - ??
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
on mouseUp pButtonNumber "VS" on mouseUp. - ??
Hi, I keep using on mouseUp pButtonNumber and on mouseUp without knowing why...
Can anyone let me quick know why/when I should use the :
- on mouseUp
versus using :
- on mouseUp pButtonNumber
and what does pButtonNumber stands for. ?
none returns any error all the time
Thanks
Can anyone let me quick know why/when I should use the :
- on mouseUp
versus using :
- on mouseUp pButtonNumber
and what does pButtonNumber stands for. ?
none returns any error all the time
Thanks
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
mouseUp is a message sent when any button on the mouse is pressed, for instance if you push down the mouse wheel instead of scrolling it, it sends a mouseDown / mouseUp message.
There is a pretty good explanation of this in the dictionary under "mouseUp" or "mouseDown", including what buttons register, etc.
As far as which of those 2 ways to handle it, pButtonNumber is just a placeholder for the number (1 through 3) of the button of the mouse that came up . You could use any place holder there, I believe currently they have the handler auto insert it as 'pButtonNumber', but it could just as easily be 'x' or anything else.
put the following in a card script, then click somewhere in the card...
There is a pretty good explanation of this in the dictionary under "mouseUp" or "mouseDown", including what buttons register, etc.
As far as which of those 2 ways to handle it, pButtonNumber is just a placeholder for the number (1 through 3) of the button of the mouse that came up . You could use any place holder there, I believe currently they have the handler auto insert it as 'pButtonNumber', but it could just as easily be 'x' or anything else.
put the following in a card script, then click somewhere in the card...
Code: Select all
on mouseUp x
answer x
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 9579
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
What Bogs said.
The parameter "pButtonNumber" is loaded with the button number pressed, and sent as a parameter attached to the "mouse" message itself. But like all parameters, it can be either used or ignored. That is up to you.
Craig
The parameter "pButtonNumber" is loaded with the button number pressed, and sent as a parameter attached to the "mouse" message itself. But like all parameters, it can be either used or ignored. That is up to you.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
Just to add, the button number is useful if you want to know whether the click is a left or right click. If the number is 1 it's a normal left click, if it's 3 then a right click. You might want to show a menu or do another special behavior for a right click.
If I don't care which button was pressed I ignore the parameter and usually leave it out.
If I don't care which button was pressed I ignore the parameter and usually leave it out.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
Code: Select all
on mouseDown XXX
switch XXX
case "1"
set the vis of img "LL" to true
break
case "2"
set the vis of img "CC" to true
break
case "3"
set the vis of img "RR" to true
break
end switch
end mouseDown
on mouseUp
wait 45 ticks
set the vis of img "LL" to false
set the vis of img "CC" to false
set the vis of img "RR" to false
end mouseUp
- Attachments
-
- Mouse Buttons.livecode.zip
- Here's the stack.
- (123 KiB) Downloaded 145 times
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
What is a real pain-in-the-bum are things such as multi-button mice.
- -
I have a few of these . . .
As well as the fairly standard 3 : Left, Right, Central Scroll wheel, it features 2 buttons in the thumb position.
These 2 extra buttons, when clicked, are not detected by LiveCode at all.
They ARE detected 'elsewhere' as I can use them to set up a rapid scroll in a web browser.
- -
I have a few of these . . .
As well as the fairly standard 3 : Left, Right, Central Scroll wheel, it features 2 buttons in the thumb position.
These 2 extra buttons, when clicked, are not detected by LiveCode at all.
They ARE detected 'elsewhere' as I can use them to set up a rapid scroll in a web browser.
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
Enhancement request submitted:
https://quality.livecode.com/show_bug.cgi?id=23127
- -
Wouldn't it be lovely if one could leverage those buttons in LiveCode?
https://quality.livecode.com/show_bug.cgi?id=23127
- -
Wouldn't it be lovely if one could leverage those buttons in LiveCode?
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
If rawKeyDown reports a key code then you should be able to use it in your own handler.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9579
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
I use a multi-button mouse, and have customized it for several different apps, including LC. But not all of those buttons generate a rawKeyDown message at all.
Craig
Craig
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
Well, certainly NOT the 2 extra buttons on my vertical DELUX horror.If rawKeyDown reports a key code then you should be able to use it in your own handler.
That bloody snake . . .
https://stackoverflow.com/questions/124 ... ith-python
- -
So . . . ?
Presumably there should be a way to detect that sort of thing in C++ . . .
Ah, X mouse buttons.
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
Here's the oddest thing I can find for sale round these parts (Bulgaria) . . . so, guess what I'm buying next?
-
-
Last edited by richmond62 on Fri Mar 19, 2021 9:13 am, edited 1 time in total.
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
Ahhhhhhh !!!
Thank you all for making it so clear and for the script, I've used Bogs simple mouse test on a "semi vertical" ( ) NG* Evo Ergo mouse
...and glad it could indeed detect 5 out of the 6 buttons it offers, answer numbers are : 1,2,3,8,9.
so it seems that LC already can detect up to button #9..on this Logite** Mouse.
(not sure what beige button 6th is meant for : maybe just a "Bluetooth pairing" button.)
..so yeah, its probably usefull for Desktop workers to take more benefit of an APP. !
Thanks again !
Thank you all for making it so clear and for the script, I've used Bogs simple mouse test on a "semi vertical" ( ) NG* Evo Ergo mouse
...and glad it could indeed detect 5 out of the 6 buttons it offers, answer numbers are : 1,2,3,8,9.
so it seems that LC already can detect up to button #9..on this Logite** Mouse.
(not sure what beige button 6th is meant for : maybe just a "Bluetooth pairing" button.)
..so yeah, its probably usefull for Desktop workers to take more benefit of an APP. !
Thanks again !
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
Not on Linux or Mac.so it seems that LC already can detect up to button #9
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
In Bulgarian:"semi vertical" ( ) NG* Evo Ergo mouse
mouse = 'mishka'
penis = 'pishka'
Just my luck when I rang up my local tech store to see if they had a vertical mouse to get the deaf lady.
Re: on mouseUp pButtonNumber "VS" on mouseUp. - ??
the IDE is installed on Linux...thought ...I have not built yet the app to test the installed mouse "reaction" then...Not on Linux or Mac.