Results 1 to 4 of 4

Thread: Some input problems

  1. #1

    Some input problems

    I'm trying to use only the input part of Phoenix for a GLScene project... Is this possible?

    I've created the phxInput and set a key...
    Code:
    Player := TphxInput.Create;
    Player.Keyboard.KeyBindings[isButton1]:= KeyBinding(VK_SPACE);
    And then in the GLScene timer(TGLCadencer), which is constantly triggering, I put:
    Code:
    Player.Update;
    If isButton1 in Player.Keyboard.States Then ShowMessage('OMG');
    Yet nothing happens.
    If I write "Player.Keyboard.States := Player.Keyboard.States + [isButton1]" right before checking for the button, I get the ShowMessage.

    I'm quite the noob to Phoenix(though I've used DelphiX quite a bit), so I'm probably making some simple mistake...

  2. #2

    Re: Some input problems

    BTW, I am using Turbo Delphi.

  3. #3

    Re: Some input problems

    You have to insert the input events with the Input.HandleEvent, so from the onkeydown etc you have to create the corresponding event and add it to the event queue:

    [code=pascal]
    uses phxEvents;

    var Event: TPHXEvent;

    Event.Keyboard.Event:= PHX_KEYBOARD_PRESSED;
    Event.Keyboard.Key:= Key;

    Events.Push(Event);
    [/code]

    How come you are mixing glScene with phx?
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  4. #4

    Re: Some input problems

    Thanks, I'll try that!

    Well, I have a lot of experience with DelphiX so I'm really used to how the DXInput works, and I really like it. So I figured I'd use the Input from Phoenix(more clear license status over DX I believe?). I'm not even sure if GLScene has a component to handle input like this. It probably has, but why bother learn something new haha

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
  •  
Comodo SSL