Enter only

Is there any way to block out all keys on the Keyboard except for the ENTER key... Ive tried playing around with the ORD command where enter has the ASCII Value of 13, but coulndt come up with anything...

Comments

  • : Is there any way to block out all keys on the Keyboard except for the ENTER key... Ive tried playing around with the ORD command where enter has the ASCII Value of 13, but coulndt come up with anything...
    :

    Do you mean in your program itself of including ALT-TAB, etc for windows functions? You can make your program only accept the enter key, but to do the latter is alot more complicated.

    Phat Nat

  • : : Is there any way to block out all keys on the Keyboard except for the ENTER key... Ive tried playing around with the ORD command where enter has the ASCII Value of 13, but coulndt come up with anything...
    : :
    :
    : Do you mean in your program itself of including ALT-TAB, etc for windows functions? You can make your program only accept the enter key, but to do the latter is alot more complicated.
    :
    : Phat Nat
    :
    :

    Yes, in the program itself. Ive reached a stage where I ask the user to enter a letter (CHAR) from the keyboard. Once hes entered one key, he should only be able to press enter.
    I can see how the code you posted in the last thread (the one using ORD13) is useful in this sense, however, I dont know how to let the program read one key only - as the users answer - and then nothing but ENTER.

  • : : : Is there any way to block out all keys on the Keyboard except for the ENTER key... Ive tried playing around with the ORD command where enter has the ASCII Value of 13, but coulndt come up with anything...
    : : :
    : :
    : : Do you mean in your program itself of including ALT-TAB, etc for windows functions? You can make your program only accept the enter key, but to do the latter is alot more complicated.
    : :
    : : Phat Nat
    : :
    : :
    :
    : Yes, in the program itself. Ive reached a stage where I ask the user to enter a letter (CHAR) from the keyboard. Once hes entered one key, he should only be able to press enter.
    : I can see how the code you posted in the last thread (the one using ORD13) is useful in this sense, however, I dont know how to let the program read one key only - as the users answer - and then nothing but ENTER.
    :
    :
    You could use the ReadKey() for that. Here is a simple code, which checks if the user has entered the right key:
    [code]
    repeat
    ch := ReadKey;
    if ch <> #13 then
    writeln('Wrong key');
    until ch = #13;
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories