Cursor Keys 
Author Message
 Cursor Keys

Can anybody tell me how to read the cursor keys on the standard 101
Enhanced keyboard?  I'm having a little trouble.  

--
Andrew Lee



Wed, 18 Jun 1902 08:00:00 GMT  
 Cursor Keys
If using TPW, then trap the WM_KEYDOWN, WM_KEYUP or WM_KEYPRESS
message, and the virtual keycode is buried in msg.wparam I think.

From memory the virtual codes are 57,58,59 and 60 for left, down,
right, up.

If using DOS version - I dunno. Sorry.
--
Alistair Galbraith



Wed, 18 Jun 1902 08:00:00 GMT  
 Cursor Keys
{==============================================


Quote:
Lee) writes:
>Can anybody tell me how to read the cursor keys on the standard 101
>Enhanced keyboard?  I'm having a little trouble.  

The cursor keys have extended key codes (ie. the actual key code is
preceeded by
a #0 character). The following procedure will allow you to ascertain the
codes for any
key.

Not Debugged.

==============================================}

Program GetKeyCodes;

Procedure GetKey(Var Code:Byte; Var Extended:Boolean);

Begin
Code := Byte(ReadKey);
If Code = 0
  Then
    Begin
    Extended := True;
    Code := Byte(ReadKey);
    End
  Else
    Extended := False;
End;

{==========Main Program=====================}

Begin
Code := 0;
Writeln('Press any key(s) to obtain code(s)');
Writeln('Press ESC to quit');
Repeat
  GetKey(Code,Extended);
  If Extended
    Then Writeln('Extended key #',Code)
    Else Writeln('Standard key #',Code);
Until (Code = 27) And (Not Extended);  { Escape key }
End.



Wed, 18 Jun 1902 08:00:00 GMT  
 Cursor Keys

Quote:

>Can anybody tell me how to read the cursor keys on the standard 101
>Enhanced keyboard?

You need two consequtive readkey statements. All special keystrokes


            'H'  : up
            'K'  : left
            'M'  : right
            'P'  : down
             end;
[...]  : normal keystrokes
end;

Erik Hjelme      Phone & fax      FidoNet BBS      E-mail



Wed, 18 Jun 1902 08:00:00 GMT  
 Cursor Keys

Quote:


>>Can anybody tell me how to read the cursor keys on the standard 101
>>Enhanced keyboard?
>You need two consequtive readkey statements. All special keystrokes


[snip]

#0 works as well:
case readkey of
 #0:case readkey of
     #72:up;
     #75:left;
     #77:right;
     #80:down;
    end;
etc

Quote:
>Erik Hjelme      Phone & fax      FidoNet BBS      E-mail


--TCA of NewOrder



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Source Code For Using Function Keys or Cursor Keys - Help :)

2. Source Code For Using Function Keys or Cursor Keys - H

3. read cursor keys

4. Reading function/cursor keys

5. read cursor key

6. How to put cursor-keys in keyboard buffer??

7. !!! Help, Cursor Keys

8. How control Cursor-Keys with TPW 1.5 in a WinCRT-Window

9. How control Cursor-Keys with TPW 1.5 in a WinCRT-Window

10. How to get cursor key events ?

11. How do I accept keypresses from the cursor keys in order to drive a simple menu ??

12. !!!! Enter Key -> Tab Key

 

 
Powered by phpBB® Forum Software