forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using %rs and get_wkey1@() in same program

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Fri Jan 02, 2015 5:05 am    Post subject: Using %rs and get_wkey1@() in same program Reply with quote

I just noticed an odd behavior. I'm using a %rs call followed by a %tx call that uses get_wkey1@() to process user input.

I created a single line edit box using %rs to capture user input. I then call my ANSI emulator which uses get_wkey1@() calls to get the user keystrokes.

What I am seeing is that the keystrokes from the user field just previously entered are being "captured" by the get_wkey1@() call. In other words, what I had previously typed is now showing up in my next created window. However, the keystrokes only show when I type something else when presented with my ANSI emulator.

It is almost as if the keyboard buffer is still being "tapped" for inputs. A character will show up every time I type something, and what is captured is the previous input.

I found that FLUSH_WKEYBOARD@() will flush the keyboard buffer, but shouldn't the buffer already be emptied after I close the %rs window?
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Jan 02, 2015 9:19 am    Post subject: Reply with quote

get_wkey1@() is an old function that predates ClearWin+.
It is rarely (if ever) needed in the context of ClearWin+ where keyboard input is either handled directly or the keyboard monitor is used.

It is not surprising that there are unexpected interactions like the one that you describe. I hope that you can find a way to overcome the problem.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Fri Jan 02, 2015 4:11 pm    Post subject: Reply with quote

Thanks, Paul. Yes, FLUSH_WKEYBOARD@() does the job, so it is invoked at the start of the ANSI screen display. Which is good thing anyway; the user sometimes pokes the wrong key when transitioning between the dialogs!

Took a while to find out what was happening, but the fix was simple (once I found the proper function call), and solved the "stray keystroke" problem that occasionally shows up in real-life.

I tried using the keyboard monitor but wasn't successful in integrating it into the calling code. I may have to revisit this now that I have more familiarity with the whole product.

Again, thanks for the information!
Bill
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group