Shop OBEX P1 Docs P2 Docs Learn Events
Missing key in keyboard.spin — Parallax Forums

Missing key in keyboard.spin

KariKari Posts: 12
edited 2007-08-09 03:56 in Propeller 1
Hello

I use PS/2 keyboard which has following layout
http://en.wikipedia.org/wiki/Image:KB_Sweden.svg

The problem is that the key between "left shift" and "z" doesn't return any keycode either alone or with "shift" pressed.
I have tried with several keyboards and all have same symptom. Other keys return a keycode.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-08 13:58
    Supporting various "national" keyboards is difficult, mostly because there are so many and each requires different modifications to the translation table in the keyboard driver. Without access to each keyboard, it's also impossible to test the modified driver. That's why, for many smaller companies, it's the local distributor that does the modifications and testing.

    If you can identify the scan code for the key you're describing, I can help you modify the table. You might be able to find documentation for one of the keyboards that you're using that gives you the codes for all the keys.
  • KariKari Posts: 12
    edited 2007-08-08 15:39
    Hello Mike

    Thank you again for a quick reply.

    I belive that the problem is not a matter of key layout being national.
    It propably is as shown in this document http://www.barcodeman.com/altek/mule/scandoc.php that this key exist "Only keyboards with 102 keys- UK keyboard (and others)"
    like said there for example key number 45 in "PC keyboard, 102 key" which is just that button.

    I am just making a keyboard layout conversion table for localising keycodes but this key doesn't give any code at all to convert.

    Regards
    Kari
  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-08 15:52
    If you look near the end of the keyboard.spin driver, you'll see a word table labelled "table" with one entry per scan code. There's one entry for scan code '61 which is the one for this key. Change the entry from $0000 to ">"<<">" and try the keyboard again.
  • KariKari Posts: 12
    edited 2007-08-08 16:11
    Did you mean like this ?


    word $CF00 '5E WakeUp
    word $0000 '5F
    word $0000 '60
    'word $0000 '61
    word ">"<<">" '61
    word $0000 '62
    word $0000 '63
    word $0000 '64

    That didn't help. No keycode. I belive i have already tried to change about all zeroes in that table.

    BTW my debugging program looks like this:

    debug := 1

    repeat
    if(kb.gotkey==true)
    key:=kb.getkey

    if(debug==1)
    print(" ") 'debug
    print_dec(key)
  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-08 16:38
    Sorry, I left out a bit. It should be "<"<<8+">".
  • KariKari Posts: 12
    edited 2007-08-08 17:37
    Works partly !

    results pressing key 45 are

    keycode is 62,
    key+ shift is 318
    ctrl+key=574
    alt+key=1086
    win+key=2110

    keycode 62 is the same as pressing key 54 with shift.

    The data to pin input is athough different as you can see from these plottings:
    Key numbers refer to previous document about 102-key keyboard.

    key13.jpg is key 13 "=" to verify data 0x55
    key54.jpg is a plot from shift + key 54 which reports keycode 62
    key45.jpg is a plot from key 45 which also now reports keycode 62


    Sorry i have to log out for this day.

    Regards
    Kari
    548 x 212 - 12K
    576 x 240 - 11K
    538 x 217 - 11K
  • KariKari Posts: 12
    edited 2007-08-09 03:53
    This is my fix to keyboard.spin for 102-key keyboard, you can find corect location from line 550.
    Number 1 is unique return from "getkey" keyboard routine.
    I hope someone who maintain keyboard.spin sees this and maybe consider to make change to release version as well.
    Graham, thank you !

    word $00F1 '59 Shift-R
    word $EB0D '5A (Enter) Enter
    word $005D '5B ]
    word $0000 '5C
    word $005C '5D \
    word $CF00 '5E WakeUp
    word $0000 '5F
    word $0000 '60
    'word $0000 '61 =key between "left shift" and "z" in 102-key keyboard
    word 1 'key returns 1 , shift+key= 257, alt+key 1025, ctrl+key=513
    word $0000 '62
    word $0000 '63
    word $0000 '64
    word $0000 '65
    word $00C8 '66 BackSpace
    word $0000 '67
    word $0000 '68
    word $C5E1 '69 End (1)
  • KariKari Posts: 12
    edited 2007-08-09 03:56
    Of coursemy thanks goes to Mike Green !
    Kari
Sign In or Register to comment.