Results 1 to 4 of 4

Thread: Keyboard Problem

  1. #1

    Keyboard Problem

    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
    Last edited by magic; 12-05-2011 at 08:15 AM.

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Keyboard Problem

    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.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3

    Keyboard Problem

    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...
    My site: DelphiTuts.com (coming soon)...

    Download Font Studio 4.21 here.

  4. #4

    Keyboard Problem

    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
    Last edited by magic; 12-05-2011 at 08:15 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •