Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Sep 25, 2017 4:37 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to make a WebButton detect an 'enter' key?
PostPosted: Tue May 07, 2013 12:54 am 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Can anyone tell me how to get WebButton detect an 'enter' key?

Thanks
Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make a WebButton detect an 'enter' key?
PostPosted: Tue May 07, 2013 12:58 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
When do you want to detect the key?
If it's in a TextField you can use this in the KeyPressed event:
If Details.KeyCode = 13 or Details.KeyCode = 3 then
' Do what you want!
end if

It will detect both enter and return.

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make a WebButton detect an 'enter' key?
PostPosted: Tue May 07, 2013 12:03 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Hi Akiland,
I need to detect for an enter button. Easier to press "enter" than click it.

Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make a WebButton detect an 'enter' key?
PostPosted: Tue May 07, 2013 1:54 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
He gave you the code for detecting the key, the question is when are you detecting it? If, for example, you're typing in a password, then you'd capture the button press for the text field.

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make a WebButton detect an 'enter' key?
PostPosted: Tue May 07, 2013 3:31 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Never tried it, but can you wrap your WE page in a <form> tag and define a default action?


Top
 Profile  
Reply with quote  
 Post subject: Re: How to make a WebButton detect an 'enter' key?
PostPosted: Wed May 08, 2013 12:59 am 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Thanks guys, your suggestions worked perfectly!

Tim


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group