Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard object with CTRL or ALT keys — Parallax Forums

Keyboard object with CTRL or ALT keys

Chris_DChris_D Posts: 305
edited 2010-08-30 18:32 in Propeller 1
I am trying to figure out how to work with CTRL or ALT key combinations. So far I have not been able to get any results.

Has anyone been able to work with these combinations?

TIA
Chris

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2010-08-30 16:03
    If you search the wiki for how the PS2 Keyboard works it is explained quite well how the keyboard works. Basically, all keys send a code when a key is pressed and another (in fact 2 codes) when a key is released. This way, the computer (e.g. the prop) can determine what key(s) were down at any point in time. It is up to the software to determine what keys were depressed simultaneously.

    I did not bother to fully understand what the Keyboard Object was doing when I did my 1-pin version, but IIRC I had an option in my code to remove the keycode translation. It may be a little easier to read than the keyboard object. See the Tools section of the OBEX under Debug 1-pin TV & Keyboard.
  • Chris_DChris_D Posts: 305
    edited 2010-08-30 17:14
    Thanks Cluso,

    I will check into that.

    Chris
  • AribaAriba Posts: 2,690
    edited 2010-08-30 17:19
    From the description of the keyboards object:
    ''      +100    if Shift
    ''      +200    if Ctrl
    ''      +400    if Alt
    ''      +800    if Win
    

    So if you press Ctrl + Space you get $20 + $200 = $220
    Alt+"1" : $431
    and so on..

    Andy
  • Chris_DChris_D Posts: 305
    edited 2010-08-30 18:32
    Ariba,

    After reading your reply, I quickly read through the description data 4 times before seeing what you referred to - it sure was there! Now I just have to do some testing to see how it all works out!

    Thanks!

    Chris
Sign In or Register to comment.