Jump to content
ti.teg.tnod.I

Check if Enter / Return Key is Pressed

Recommended Posts

How do I check to see if the enter / return key is pressed?

 

IsKeyDown(chr(13));

 

Causes internal error 20.

 

edit: Actually

 

begin
 repeat
   if (IsKeyDown(Chr(13))) then
     WriteLn('there');
 until (False);
end.

 

Works for me

 

----

 

There's IsFunctionKey but I don't think you can use return key

 

function IsFunctionKeyDown(Key: Byte): Boolean;
Checks if the given function key is down.
Meanings of Key:
0: SHIFT
1: CONTROL
2: ALT
3: LEFT SHIFT
4: LEFT CONTROL
5: LEFT ALT
6: RIGHT SHIFT
7: RIGHT CONTROL
8: RIGHT ALT

 

Maybe try Chr(10)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...