Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Mon Nov 20, 2017 2:22 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Apr 26, 2011 7:56 am 
Offline

Joined: Tue Nov 18, 2008 11:59 am
Posts: 19
I'm progamming a G56 with Qlarity. I've turned AutoShift off (both using Power On SetUp and inline using:
SetSystemSetting(SYS_AUTOSHIFT, FALSE, SYSACT_ALWAYS)

I then used the hotkeyV2 for the shift key as follows:
Code:
init parent := default
init hotkeyvalue := 0x0800

func handleKeyPress()

    if shift_flag then
        shift_flag = false
        setLED(LED_OFF, 0)
    else
        shift_flag = true
        setLED(LED_ON, 0)
    endif

endfunc


The hotkey code doesn't execute in terminal or simulation (also set autoshift to off in simulator).
An EditBoxV2 has focus and when I press the shift key a non-printable character appears.
Using the simulator, this character's value appears to be [0] which seems like it could be the lower order byte from the unicode for the shift key (0x0800).

If I set handleallkeys = true
then the code will execute except it executes for all keys (not just shift) as the name implies.

When I press the shift key I just want to set/clear the flag and LED.
I'm using a lot of additional hotkeys that don't give me any issues.
Any thoughts on what I'm doing wrong?

Thanks in advance.


Top
 Profile  
 
PostPosted: Tue Apr 26, 2011 8:14 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
It sounds like you need to specify a value for the Shift key in the "KeyTranslator" object. Go to the KeyTranslator object in the "Object Tree" and double click on the "TranslationTable" property to display the "Keypad string definition" dialog (see picture). Here you can specify a value for the shift key that is not already being used.

Attachment:
key_trans_shift.JPG
key_trans_shift.JPG [ 67.68 KiB | Viewed 1263 times ]


For this example, the "hotkeyvalue" property would be set to '~'.

Code:
init hotkeyvalue := '~'

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Tue Apr 26, 2011 8:21 am 
Offline

Joined: Tue Nov 18, 2008 11:59 am
Posts: 19
Thanks Ron.
That did the trick.


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