automate enter key press
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
automate enter key press
Is there any way to automate an enter key press when "on mouseup" event.
-
- Livecode Opensource Backer
- Posts: 9380
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
-
- Livecode Opensource Backer
- Posts: 9380
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: automate enter key press
You CAN send a simulated key press to a button:
Download my stack that demonstrates this here:
viewtopic.php?t=27644
Code: Select all
on mouseUp
send "rawKeyUp 108" to btn "xx"
end mouseUp
viewtopic.php?t=27644
-
- Livecode Opensource Backer
- Posts: 9380
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: automate enter key press
You can also do this sort of thing:
-
BUT it will NOT type into the field.
-
Code: Select all
on mouseUp
send "rawKeyUp 108" to fld "ff"
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: automate enter key press
Why not just send the "enterKey" message? On a card with one button, in the button script:
And in the card script:
Click the button or press the enter key, you get a random number.
Craig
Code: Select all
on mouseUp
enterkey
end mouseUp
Code: Select all
on enterkey
answer random(99)
end enterkey
Craig
-
- Livecode Opensource Backer
- Posts: 9380
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: automate enter key press
Sorry: I went off on a tangent about faking any key press.
-
-
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: automate enter key press
Richmond.
I am always on a tangent. It is getting back onto the circle that keeps tripping me up.
Craig
I am always on a tangent. It is getting back onto the circle that keeps tripping me up.
Craig
Re: automate enter key press
thank you for responding in this thread.
I'm building an app using a "browser" widget with a live chat app.
usually when I write a chat and to send it I press the "enter" key on the computer keyboard.
I want to change the function that usually uses the "enter" key to send messages. replaced by just a click of the mouse.
is this possible?
I'm building an app using a "browser" widget with a live chat app.
usually when I write a chat and to send it I press the "enter" key on the computer keyboard.
I want to change the function that usually uses the "enter" key to send messages. replaced by just a click of the mouse.
is this possible?
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: automate enter key press
Hi.
Have you repeated your request, or have I missed your intent? Otherwise, what is missing from my post?
Craig
Have you repeated your request, or have I missed your intent? Otherwise, what is missing from my post?
Craig
Re: automate enter key press
@dunbarx
your script in the previous post, can be applied if within the scope of the livecode object. but for the browser widget as in my case it can't be applied.
I haven't found a way. I want to make the application run the command "enter" key press every 10 seconds with the widget browser.
your script in the previous post, can be applied if within the scope of the livecode object. but for the browser widget as in my case it can't be applied.
I haven't found a way. I want to make the application run the command "enter" key press every 10 seconds with the widget browser.
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: automate enter key press
I have never used a widget in any project, so I am no expert on those gadgets. If we were purely inside LC, I might suggest a timer that sent the "enterKey" message to the card, or wherever, every 10 seconds. This is simple.I want to make the application run the command "enter" key press every 10 seconds with the widget browser.
So, everyone, is there any access to a widget in the sense that one can write a handler attached to that widget? Or is the fact that the widget is "visible" a property that can be exploited in the same way?
craig
-
- VIP Livecode Opensource Backer
- Posts: 9833
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: automate enter key press
I don't know if "click at <loc>" works in the Browser widget, but maybe worth trying.
Does the chat app use websockets or polling?
Does the chat app use websockets or polling?
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: automate enter key press
yes I use the websocket protocol.
-
- VIP Livecode Opensource Backer
- Posts: 9833
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: automate enter key press
Do they also offer an API with regular Unix sockets?
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: automate enter key press
as i know they only use tcp/ip socket
by using socket.io