Shift-/Control-/Option-CLICK; what is the message sent?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Shift-/Control-/Option-CLICK; what is the message sent?
Specifically, if I wanted to send a (say,) shift-click to an object, how would I script it?
Thanks,
Sri
Thanks,
Sri
Re: Shift-/Control-/Option-CLICK; what is the message sent?
Sri.
Would this help you make your gadget? Make two buttons and a field on a new card. In the script of btn 1:
In btn 2:
Click on btn 2 with and without the shiftKey.
Craig
Would this help you make your gadget? Make two buttons and a field on a new card. In the script of btn 1:
Code: Select all
on mouseUp
if the shiftKey is down then put "Shift" into fld 1
else put "Click" into fld 1
end mouseUp
Code: Select all
on mouseUp
send "mouseUp" to btn 1
end mouseUp
Craig
Re: Shift-/Control-/Option-CLICK; what is the message sent?
Craig:
I'm afraid not.
I want to send "Shift-mouseClick" to an object by script. Say, I have no buttons, nothing.
I want the object to recognize that the mouse was clicked on it while the shift key was down.
The object's code already contains ways of handling shift-mouseClick and I don't want to mess with it (because I don't know where it is, say).
In other words, is there a message that is equivalent of a (fictitious) message
mouseUp buttonNumber, specialKeyPressed
If it is not there, I think there should be. Someone must surely have put in such a feature request in the past.
Regards,
Sri.
I'm afraid not.
I want to send "Shift-mouseClick" to an object by script. Say, I have no buttons, nothing.
I want the object to recognize that the mouse was clicked on it while the shift key was down.
The object's code already contains ways of handling shift-mouseClick and I don't want to mess with it (because I don't know where it is, say).
In other words, is there a message that is equivalent of a (fictitious) message
mouseUp buttonNumber, specialKeyPressed
If it is not there, I think there should be. Someone must surely have put in such a feature request in the past.
Regards,
Sri.
Re: Shift-/Control-/Option-CLICK; what is the message sent?
Sri.
There is no message embellished with your extra parameter. I am not sure how you could kluge one. So, fearlessly, what is missing from the simple handler?
Craig
Now I am confused. What is missing, then, with simply placing the button 1 handler in the card script, and maybe adding a bit of code dealing with the target?I'm afraid not.
There is no message embellished with your extra parameter. I am not sure how you could kluge one. So, fearlessly, what is missing from the simple handler?
Craig
Re: Shift-/Control-/Option-CLICK; what is the message sent?
Hi Craig:
I didn't explain the context of my question in my original post.
I didn't mean to imply that your solution doesn't work. It does.
My question relates to another question posted on this board about the difficulty in highlighting multiple lines of a datagrid on mobile where there is no shift key available (when the keyboard is not invoked).
Mikey had provided a workaround.
I thought it would be simple if we put a toggle switch (checkbox....) to activate the shift key, and when the user taps the shift key and then taps a datagrid line, if we interrupt it and send "shift-click" instead, this would highlight multiple lines using the built-in mechanism (and we would then reset the shift key).
Initially, it wouldn't work when I handled the mouseUp at the Datagrid level as it was higher on the message path than I needed. I didn't want to mess with the innards.(row or column control code, which I thought I needed to).
It was in this context that I wondered if I could
dispatch "mouseUp" to the target with "1", "shiftKey"
if such a message existed.
Regards,
Sri
EDIT: Added the underlined phrase for added clarity.
I didn't explain the context of my question in my original post.
I didn't mean to imply that your solution doesn't work. It does.
My question relates to another question posted on this board about the difficulty in highlighting multiple lines of a datagrid on mobile where there is no shift key available (when the keyboard is not invoked).
Mikey had provided a workaround.
I thought it would be simple if we put a toggle switch (checkbox....) to activate the shift key, and when the user taps the shift key and then taps a datagrid line, if we interrupt it and send "shift-click" instead, this would highlight multiple lines using the built-in mechanism (and we would then reset the shift key).
Initially, it wouldn't work when I handled the mouseUp at the Datagrid level as it was higher on the message path than I needed. I didn't want to mess with the innards.(row or column control code, which I thought I needed to).
It was in this context that I wondered if I could
dispatch "mouseUp" to the target with "1", "shiftKey"
if such a message existed.
Regards,
Sri
EDIT: Added the underlined phrase for added clarity.
Last edited by sritcp on Sat Nov 07, 2015 12:52 am, edited 4 times in total.
Re: Shift-/Control-/Option-CLICK; what is the message sent?
Hi Bernd:bn wrote:Code: Select all
click at the loc of button 1 with optionKey
As you can see from my previous comment, I need to send the "shift-click" to the datagrid line that was simple-clicked.
Regards,
Sri
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Shift-/Control-/Option-CLICK; what is the message sent?
For the future maybe we should submit an enhancement request for the DataGrid to support the field object's toggleHilites property?
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
Re: Shift-/Control-/Option-CLICK; what is the message sent?
1. I was under the (mistaken?) impression that Datagrid was Trevor DeVore's single-handed creation which was bolted on to LiveCode's core and that no further development is being done on DataGrid (other than making it compatible with the successive versions of LC).FourthWorld wrote:For the future maybe we should submit an enhancement request for the DataGrid to support the field object's toggleHilites property?
2. I still think an additional, optional parameter to the mouseUp, viz.,
mouseUp buttonNumber, specialKeyPressed
would add more general flexibility.
Regards,
Sri
Re: Shift-/Control-/Option-CLICK; what is the message sent?
Sri.
Surely any enhancement is useful. Consider what Bernd pointed out with the "click" command. That is a good example of a perfect place to include those sorts of extra parameters.
And as long as it does not break legacy code; "mouseUp" is a message one must be careful with.
Craig
Surely any enhancement is useful. Consider what Bernd pointed out with the "click" command. That is a good example of a perfect place to include those sorts of extra parameters.
And as long as it does not break legacy code; "mouseUp" is a message one must be careful with.
Craig
Re: Shift-/Control-/Option-CLICK; what is the message sent?
Craig:
1. Yes, I agree with you that one shouldn't mess with something as fundamental as the mouseUp message. It is impossible to visualize all possible consequences.
2. I took at a second look at Bernd's suggestion and I think I can use it to solve my problem (Thanks, Bernd!)
Insert in the frontscript:
Regards,
Sri
1. Yes, I agree with you that one shouldn't mess with something as fundamental as the mouseUp message. It is impossible to visualize all possible consequences.
2. I took at a second look at Bernd's suggestion and I think I can use it to solve my problem (Thanks, Bernd!)
Insert in the frontscript:
Code: Select all
if shiftKeySwitchIsOn then click at the loc of the target with shiftKey
Sri