PDA

View Full Version : Keyboard Problem



magic
03-07-2006, 01:44 PM
After about 10 years of no programming I tried lots of different software to decide what language I should use. I settled on Pascal - easier to learn than C++ and programs can be knocked up in a relativly short time.

I have one problem. To get me back into developing I decieded to write a little tetris game using the keyboard. Now I can setup the screen put my graphics on there and control the game as you would any other - the only problem I am having is that i cannot use the keyboard unless I have focus on the console window.

I am only using graph, crt and keyboard. There should be nothing strange about this. Does anyone know how I can use the keyboard while the focus is on my game screen?

Thanks in advance.
________
LilyH (http://www.girlcamfriend.com/cam/LilyH/)

WILL
03-07-2006, 02:03 PM
Well for starters what compiler are you using? Free Pascal, Delphi? And what API(s), if any are you using to control your screen/windowed modes and/or keyboard input?

This will at least give us a good starting point to try to help you out.

Nitrogen
03-07-2006, 03:17 PM
Indeed. Are you using Windows or Linux?

If Windows, I know you could set a keyboard hook using the API, but most people just use DirectInput I think...

magic
04-07-2006, 12:02 PM
I am using Windows and Lazarus/Free Pascal.

I am only using the most basic of units at the moment. Graph, Crt and Keyboard. I only wanted to use the standard units because I was going to move the code over to PPC Amiga when Free Pascal was available but in truth it does not matter that much.

I have opened the screen with using Graph, it is actually a full size window but this is enough for me to develop with.
________
HERBALAIRE VAPORIZER REVIEW (http://herbalairevaporizer.com/)