Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Wed Nov 22, 2017 5:51 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: links to example code
PostPosted: Wed Nov 02, 2011 1:06 pm 
Offline

Joined: Thu Aug 09, 2007 4:44 pm
Posts: 67
I want to check out an example that was linked to in an older post in this forum, but I get an "error 403 - Forbidden" message and can't access the file. Is there a new place where Qlarity sample code has been located?

This is the link I was looking for, an example of overriding the arrow keys:

files/arrowhotkeyex.qly

Thanks,

Aaron


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 2:26 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Is there any chance you can link the post? Over the years, this forum has migrated a couple of times to new hardware and new hosting. I suspect that that file link got broken during one of the migrations. (The error you experienced is the generic file not found error)

It is possible one of us may still have that example in our local document cache though.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 2:31 pm 
Offline

Joined: Thu Aug 09, 2007 4:44 pm
Posts: 67
It's at the bottom of this post:

viewtopic.php?f=6&t=151&p=444

If you can;t find that file, I am looking for an example of how to use GetKeyCodeInfo in HotKeyV2.

Thanks

Aaron


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 2:40 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 a quick and dirty example that I just whipped together. This code is in a hotkeyV2 object. The hotkey handles keys 0-9 but ignores all other keys

Code:
init parent := splashscreen
init handleallkeys := true

func ProcessBid(KeyASCII as unibyte, KeyString as charstr, BidType as integer) returns boolean
    'Ignore all but 0-9
    return (keyAscii >= '0') and (keyAscii < '9')
endfunc

func handleKeyDown()
    dim keyAscii as unibyte
    dim keyModifier as unibyte
    dim sourceIsKeypad as boolean
    dim keyString as charstr

    'Find some information about the key that was pressed
    GetKeyCodeInfo(keyAscii, keyModifier, sourceIsKeypad, keyString)

    _print("ASCII=" + str(keyAscii) + ",   ShiftDown=" + ->
         str((keyModifier and KEY_SHIFT) <> 0) + ->
         ",   source_is_keypad=" + str(sourceIsKeypad) + ",   text=" + keystring)
endfunc

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 2:47 pm 
Offline

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

That's what I needed.


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 3:19 pm 
Offline

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

I have a G55 that has a 45 key keypad, which is not included as a default in the Qlarity software. I made up my own bitmap image and mapped most of the keys appropriately, but the Keytrans object translation table has the Numlock, Capslock, and Power button mapped to nothing and I'm not sure how to identify these keys. Any help?


Thanks


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 3:26 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Does your keypad have Numlock and Capslock keys? If it does, I would just pick some other keyboard key that is not present on your keypad to represent it. For example F12. The key translator, and indeed the entire keypad subsystem doesn't have any built in provision to handle Numlock and Capslock, so you will need to handle those yourself manually.

As far as the power key goes -- if it is a standard power key (i.e. it is handled by the system to turn the unit off), leave the key mapping as nothing, but on the key layout screen, select the key and in the "Key Type" drop list, select Power Key. If, instead, the power key should be treated as a normal key, just pick another keyboard key to map it to.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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