Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sat Nov 18, 2017 11:52 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: keypress repeat rate
PostPosted: Mon Nov 07, 2011 4:11 pm 
Offline

Joined: Thu Aug 09, 2007 4:44 pm
Posts: 67
I am using HotkeyV2 on a G55 to send arrow key presses to a keypadspinnerV2 object, in order to increment the value up or down. Right now I am just changing the "value" of the keypadspinnerV2 object by one count up or down, depending on which arrow is pressed. I would like to be able to hold the arrow button down and have the value continue to change, like it does when I click and hold the arrow buttons on the object itself. Is there a way to set a click repeat rate on the keypress, or some other way of doing this?

Thanks much.


Top
 Profile  
 
 Post subject: Re: keypress repeat rate
PostPosted: Mon Nov 07, 2011 4:50 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Here is one approach that will work by sending fake screen messages to the spinner (note: this only works if the spinner is visible, nothing is obscuring the up down buttons on it and they are on the right side of the object).


Code:
'Hotkey to increment
init hotkeyvalue := 'A'

func handleKeyPress()
    FakeScreenMsg(SCREEN_PUSH, GetPosInfo(keypadspinner_1, GET_XGLOBAL)+ GetPosInfo(keypadspinner_1, GET_WIDTH)-2, GetPosInfo(keypadspinner_1, GET_YGLOBAL)+1, 0, 0)
endfunc

func handleKeyRelease()
    FakeScreenMsg(SCREEN_RELEASE, GetPosInfo(keypadspinner_1, GET_XGLOBAL)+ GetPosInfo(keypadspinner_1, GET_WIDTH)-2, GetPosInfo(keypadspinner_1, GET_YGLOBAL)+1, 0, 0)
endfunc


Code:
'Hotkey to decrement
init hotkeyvalue := 'B'

func handleKeyPress()
    FakeScreenMsg(SCREEN_PUSH, GetPosInfo(keypadspinner_1, GET_XGLOBAL) + GetPosInfo(keypadspinner_1, GET_WIDTH)-2, GetPosInfo(keypadspinner_1, GET_YGLOBAL) + GetPosInfo(keypadspinner_1, GET_HEIGHT)-2, 0, 0)
endfunc

func handleKeyRelease()
    FakeScreenMsg(SCREEN_RELEASE, GetPosInfo(keypadspinner_1, GET_XGLOBAL)+ GetPosInfo(keypadspinner_1, GET_WIDTH)-2, GetPosInfo(keypadspinner_1, GET_YGLOBAL) + GetPosInfo(keypadspinner_1, GET_HEIGHT)-2, 0, 0)
endfunc


If you cannot meet the criteria I gave at the top of the post, you can always create a global timer that you enable on key press and disable on key release. That timer can then increment or decrement the keypad spinner value when it ticks. This technique will work whether or not the spinner is visible.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject: Re: keypress repeat rate
PostPosted: Mon Nov 07, 2011 5:57 pm 
Offline

Joined: Thu Aug 09, 2007 4:44 pm
Posts: 67
Thanks Jeremy,

I used the timer because the spinner object is hidden and it works great.

Aaron


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

All times are UTC - 7 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
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group