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 / Useing function keys to do something

Author
Message
Fangs
16
Years of Service
User Offline
Joined: 24th Oct 2008
Location: 40 some miles North of the Emerald Coast
Posted: 9th Nov 2008 20:23
This works fine, but I would much rather use one key press (F5) to do the job. I've tried everything in the help pages, but obviously not the right thing. Can someone help me out?

if cmd$ = "xxx"
gosub yyyy
return
endif

The Fangman
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 9th Nov 2008 21:13 Edited at: 9th Nov 2008 21:24
You can use the scancodes for the function keys with keystate. I am at my work computer so I don't have the scancode available. I'm sure it's in a number of code snippets here. I'll try to hunt it down for you.

The only thing else you would need to do is have flags for release (keyup) and press(keydown) to prevent the program from freaking out when the key is held.

edit
Here, check out cloggy's implementation of a keyboard monitor

"When I look at that square... I wish FPSC noobs would stay on their side of the forums and stop polluting these boards." - Benjamin
Fangs
16
Years of Service
User Offline
Joined: 24th Oct 2008
Location: 40 some miles North of the Emerald Coast
Posted: 9th Nov 2008 23:57
Hey zenassem

That'll get it done!

Thanx

The Fangman

Login to post a reply

Server time is: 2024-11-25 16:46:58
Your offset time is: 2024-11-25 16:46:58