Results 1 to 2 of 2

Thread: DXinput - Implementing user definable controls

  1. #1

    DXinput - Implementing user definable controls

    Hi all,

    What would you all suggest is the best way of implementing user definable controls for my game?

    Do I need to somehow read the complete keyboard state using DXinput when the user selects a key for left/right/up/down etc? Or do I use the form keydown event and convert that somehow?

    Should I be querying dxinput.Keyboard.States?

    Incidentally, can you just check dxinput1.Keyboard.States to see if any of the keys are pressed? The reason I ask is I had problems trying to check for the ' and / keys before. Any links to the correct scancodes?

    Thanks.

  2. #2

    DXinput - Implementing user definable controls

    I made my own system along the lines you suggested by asking the user to input a button on the controller to define control. i set a seperate part for keyboard setting whereby a person clicks inside a edit box (read only edit) and then entered a key.

    The code for Keyboard controls is as follows [place the code in editbox keydown event]:

    Code:
    Edit1.text:=inttostr(ord(key) );//this will show the ascii key number
    Mainfm.dxinput1.Keyboard.KeyAssigns[isbutton29,0]:=(ord(key));
    keyassigns will assign a new key in this instance to isbutton29 and the first of the 3 options for it (0).

    I use memo or richedits to save the selectiona dn then load the key back up when the app is run.

    -----------
    For control you will probably have to set variables such as "input1Player1" and then set those. input1player1 would be a Tdxinputstate

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
  •