Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How do I check for a key entry that includes a CTRL ?

Author
Message
thedubdude
21
Years of Service
User Offline
Joined: 24th May 2003
Location: San Jose, Ca.
Posted: 31st Dec 2003 22:16
I want to see if a CTRL + "some key" is pressed. If I use the :

key$=ENTRY$()

command to get an input. What will key$ be for a CTRL + "key" combination? I want to use an if then to check if key$="??" to see if the combination is pressed. Thanks.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Dec 2003 22:21
They range from ascii value 1 to 26 ... CTRL-A=1 to CTRL-Z=26

So you can do either of the following

if asc(key$) = 1 ...
if key$ = chr$(1) ...

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
thedubdude
21
Years of Service
User Offline
Joined: 24th May 2003
Location: San Jose, Ca.
Posted: 31st Dec 2003 22:42
Thanks. How about capitals ? Is a CTRL+"A" = chr$(27) or is case not recognized?
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 1st Jan 2004 12:11
I think there's a

IF CONTROLKEY()=1

or

IF CTRL()=1

function.

Juvenile Industries
Current Project: The First Room (FPS)
Soon to come:An rts, and a snowball fight game
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jan 2004 15:03
Case is ignored for control characters.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 1st Jan 2004 21:25

17 is code for 'W' or something.

Am I the only one here who's really confused?

Login to post a reply

Server time is: 2024-09-21 13:44:15
Your offset time is: 2024-09-21 13:44:15