Announcement

Collapse
No announcement yet.

Key Code Table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Robert E. Carneal
    replied
    Jim- that code helps VERY much. Thank you.

    Tom- I knew IBM had their own quirks, but I had not know the DEL
    key on the keyboard was different from the CONTROL BACKSPACE.
    Thanks for bringing that to light.

    I will be using both of you guys' tips. Thanks again very much.

    Robert

    ------------------

    Leave a comment:


  • Tom Hanlin
    replied
    The results will vary depending on the technique you use to get the
    key, the keyboard hardware, and the code page in use. Some codes are
    more standard than others, e.g., Control-Enter will get you Linefeed,
    and Control-Backspace will get you the ASCII DEL code, CHR$(127)...
    not to be confused with the DEL key, which IBM cleverly assigned a
    completely different code.

    Combination codes are based on no more than a single shift key (where
    "control", "alt" and "shift" are considered shift keys). You don't
    have to consider combinations like control+alt+something. They're not
    available, unless you're using ON KEY keyboard event handling, which
    doesn't work the same way as, say, INKEY$.

    You can find a "scan code" chart in the PB/DOS online help: F1, F1,
    "Keyboard scan codes".

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Jim Gillem
    Guest replied
    The following code is for all to use free of any strings:
    (I created this some time ago when I needed the list you are
    looking for.

    rem ascii.exe
    $compile exe
    TOP1:
    COLOR 15,1,0
    CLS
    locate 5,10 rint"Press a key to evaluate ascii makup (ascii.exe 7/10/96)"
    QQ:
    Q$=INKEY$
    IF Q$="" THEN GOTO QQ
    LOCATE 10,10:PRINT"LEN = ";LEN(Q$)
    LOCATE 11,10:PRINT"L,CHR ";LEFT$(Q$,1)
    LOCATE 12,10:PRINT"L,ASC ";ASC(LEFT$(Q$,1))
    LOCATE 13,10:PRINT"R,CHR ";RIGHT$(Q$,1)

    LOCATE 14,10:PRINT"R,ASC ";ASC(RIGHT$(Q$,1))
    LOCATE 15,10:PRINT"R,CHR ";RIGHT$(Q$,1)
    LOCATE 17,10:PRINT"PRESS ANY KEY or Escape"
    Q1:
    Q11$=INKEY$
    IF Q11$="" THEN GOTO Q1
    if asc(q11$)=27 then system
    GOTO TOP1

    Feel free to use of modift it in any manner.

    [email protected]


    ------------------

    Leave a comment:


  • Robert E. Carneal
    started a topic Key Code Table

    Key Code Table

    I am looking for a "Key Code Table." I hope that is the correct
    term for it.

    If I press ALT Nine key, it yields a character string of two
    charactes in length, the first character being null and the
    second character 129th decimal on the Ascii table.

    What I am looking for is a table that will tell me what key
    combinations will yield which values so I can catch them as the
    user presses those key combinations.

    Example:
    What is the value when Control Backspace is entered?
    Control + Shift + ? (Press & hold CONTROL key, hold SHIFT key,
    and press the slash "/" key) I am hoping to find one for
    all the key combinations. Surely there is a complete
    table of these somewhere already written.

    Thank you.

    [This message has been edited by Robert Carneal (edited May 15, 2003).]
Working...
X