Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Artificial Keyboard for Games

Artificial Keyboard for Games

Scheduled Pinned Locked Moved C / C++ / MFC
helpgame-devjsonquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    selethd
    wrote on last edited by
    #1

    I want to have a home made arcade wheel, stick, or control panel plugged into a printer(lpt?) port, and have a program that takes the signals from the printer port and converts them into keypresses so that games like MAME, Half-Life, GTA3 and the like can benefit from having custom made controls. The only problem is creating an artificial keypress so that the game thinks the up arrow key is pressed I want it to. Someone told me to code a driver, way over my head, and im not sure if its totally necessary. The other windows API's ive tried work in applications like notepad, but not with games, that probably have a more direct access to the keyboard. So I looked also int Windows Hooks, but I dont totally understand how they work, or if you can insert data into the keyboard stream, all tuts and discussions on this just read keyboard input. So please help with any ideas, or knowledge that can solve this problem, thanks.

    B H 2 Replies Last reply
    0
    • S selethd

      I want to have a home made arcade wheel, stick, or control panel plugged into a printer(lpt?) port, and have a program that takes the signals from the printer port and converts them into keypresses so that games like MAME, Half-Life, GTA3 and the like can benefit from having custom made controls. The only problem is creating an artificial keypress so that the game thinks the up arrow key is pressed I want it to. Someone told me to code a driver, way over my head, and im not sure if its totally necessary. The other windows API's ive tried work in applications like notepad, but not with games, that probably have a more direct access to the keyboard. So I looked also int Windows Hooks, but I dont totally understand how they work, or if you can insert data into the keyboard stream, all tuts and discussions on this just read keyboard input. So please help with any ideas, or knowledge that can solve this problem, thanks.

      B Offline
      B Offline
      bikram singh
      wrote on last edited by
      #2

      Look into the SendInput() and keybd_event() functions in MSDN. Bikram Singh

      S 1 Reply Last reply
      0
      • B bikram singh

        Look into the SendInput() and keybd_event() functions in MSDN. Bikram Singh

        S Offline
        S Offline
        selethd
        wrote on last edited by
        #3

        I tried SendInput() and its not 'root' enough to send a keypress to the games im wanting to work. Anyone ever create somthing or hear of anyone who has created somthing that can insert a keypress to where its inserted at the earliest possible point in the line? Thanks anyway bikram

        B 1 Reply Last reply
        0
        • S selethd

          I tried SendInput() and its not 'root' enough to send a keypress to the games im wanting to work. Anyone ever create somthing or hear of anyone who has created somthing that can insert a keypress to where its inserted at the earliest possible point in the line? Thanks anyway bikram

          B Offline
          B Offline
          bikram singh
          wrote on last edited by
          #4

          so you mean you want to sent keystrokes to a game such as Need For Speed and suchlike? Created with the DirectX library? Or do these games run in a DOS window? For DirectX-based games, I dont suppose SendInput() would work, cos DirectX probably works much closer to the keyboard driver, i'm guessing. So, look into MSDN dox on DirectInput... For DOS based games, I havent a clue as to what could be done... maybe a TSR ? Bikram Singh

          S 1 Reply Last reply
          0
          • S selethd

            I want to have a home made arcade wheel, stick, or control panel plugged into a printer(lpt?) port, and have a program that takes the signals from the printer port and converts them into keypresses so that games like MAME, Half-Life, GTA3 and the like can benefit from having custom made controls. The only problem is creating an artificial keypress so that the game thinks the up arrow key is pressed I want it to. Someone told me to code a driver, way over my head, and im not sure if its totally necessary. The other windows API's ive tried work in applications like notepad, but not with games, that probably have a more direct access to the keyboard. So I looked also int Windows Hooks, but I dont totally understand how they work, or if you can insert data into the keyboard stream, all tuts and discussions on this just read keyboard input. So please help with any ideas, or knowledge that can solve this problem, thanks.

            H Offline
            H Offline
            Henry miller
            wrote on last edited by
            #5

            do a google search for "build your own arcade controls". Also search for MAME. There are a bunch of people into doing things like this, and you will find most of them by some form of the above searches. Their goals are not exactly yours, but they can help you out a lot anyway. For starters why are likely to recomend that you not use the lpt port (though they can tell you how to make it work), as there is hardware designed for this purpose, most likely (but not always) with the drivers you need already made! Just a matter of figuring out what to buy and what to make.

            S 1 Reply Last reply
            0
            • H Henry miller

              do a google search for "build your own arcade controls". Also search for MAME. There are a bunch of people into doing things like this, and you will find most of them by some form of the above searches. Their goals are not exactly yours, but they can help you out a lot anyway. For starters why are likely to recomend that you not use the lpt port (though they can tell you how to make it work), as there is hardware designed for this purpose, most likely (but not always) with the drivers you need already made! Just a matter of figuring out what to buy and what to make.

              S Offline
              S Offline
              selethd
              wrote on last edited by
              #6

              Ok, ill do that, thanks for a point in the right direction :)

              1 Reply Last reply
              0
              • B bikram singh

                so you mean you want to sent keystrokes to a game such as Need For Speed and suchlike? Created with the DirectX library? Or do these games run in a DOS window? For DirectX-based games, I dont suppose SendInput() would work, cos DirectX probably works much closer to the keyboard driver, i'm guessing. So, look into MSDN dox on DirectInput... For DOS based games, I havent a clue as to what could be done... maybe a TSR ? Bikram Singh

                S Offline
                S Offline
                selethd
                wrote on last edited by
                #7

                No dos games, only windows, but yes, ones that proably use direct input, so it needs to be very root.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups