[PLUGIN] Input System v0.96b (21/03/2011): Keyb+Mouse+Joy

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Set of 21 Food plus 6 boards, for different kind of games
  • Hello all,

    What it does:

    Manages Keyboard, Mouse and Joystick through DirectX using the Win32 part of OIS (http://sourceforge.net/projects/wgois/).

    I've merged "Keyboard & Mouse" plugin actions/conditions/expressions and I've added an "Arm" feature like in the "Custom Controls" plugin by Lucid

    There are also many other things to discover

    Force Feedback has been added in v0.92b but it's not fully tested and may not work properly.

    ToDo:

    • Create a ForceFeedback testing tool with CGUI
    • Intregrate OIS 1.3: adds XInput (XBox 360 controller)

    How to use it:

    See the included examples, everything is in here. If more is needed, I will publish some howtos.

    Installation:

    Download the zip file and put the Plugin directory with the csx files into Construct's plugins directory.

    Download:

    https://sourceforge.net/projects/sglorzscplugs/files/Input%20System/

    Release note

    v0.96b

    ------

    • Update: when presetting nonexistent button, Slider or POV, an empty value will be set when a joystick is selected.

    v0.95b

    ------

    • Change license to LGPL

    v0.94b

    ------

    • Update:

    . New Mouse condition: "On any mouse button down" called on any mouse button pressed.

    . New Mouse condition: "On any mouse button release" called on any mouse button released.

    . New Keyboard condition: "On any key down" call on any key down.

    . New Keyboard condition: "On any key release" called on any key down.

    . New Mouse expression: "Get last mouse button down", 0 is left, 1 is right, 2 is middle and 8 is unknown.

    . New Mouse expression: "Get last mouse button release", 0 is left, 1 is right, 2 is middle and 8 is unknown.

    . New Keyboard expression: "Get last key down", 0 is unknown.

    . New Keyboard expression: "Get last key release", 0 is unknown.

    • Note: see example 4 (Input System4.cap) for more details.

    v0.93b

    ------

    • Bug: crash when presetting nonexistent button, Slider or POV. Now last valid value will be used.

    v0.92b

    ------

    • Update:

    . New joystick action: "Set POV number of directions" with one parameter directions (4 or . In 4 directions mode, joysticks' POV diagonal events (NE, SE, NW, SW) trigger 3 events (e.g. NW will trigger N, W and NW).

    . New controls action: "Set control enabled" allows to enable/disable a control for a player.

    . New controls condition: "Control is enabled?" checks if a control is enabled for a player.

    • Added ForceFeeback (not fully tested, use at your own risk ^_^)

    v0.91b

    ------

    • Bug: relative X and Relative Y were the same.
    • Bug: SetControlConfigData, previous controls were not deleted
    • Update:

    . "Set control default component" renamed to "Set control preset", to init control directly and if it's a joystick, it'll take the first one available.

    . "Init control default component device" renamed to "Set presets joystick", to set preset's joystick to use and to change the used joystick of previous presets.

    . New controls action: "Reload contols preset" to reset controls with already defined presets.

    . New controls action: "Clear presets" to delete all presets

    . New controls action: "Clear Controls" to delete all controls

    v0.9b

    -----

    First delivered version

  • So far so good, and it seems pretty complete.

    I do think a little more info like setting controls etc. is needed.

    Great job!

  • Many thanks. Look forward to testing this later

  • RelativeMouseX is the same as RelativeMouseY

  • RelativeMouseX is the same as RelativeMouseY

    Yes, bug spotted, it's a bad cut/paste, my usual

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • WHOA! So fast!

    Testing, RIGHT AWAY!

  • Whoa. Just whoa. Tomorrow I'm trying it out with a joystick but... it seems it has everything.

    Not everything I need, I mean EVERYTHING. I looked around SDL's control system before and I know what can be done, and I see it's all there. Congratulations, sir

    I tried the bundled demos and something weird happens when hitting F10. I just now realized it acts just like left-alt :O so I guess we shouldn't use it, as Windows freezes the application and focuses on the window controls.

    Everything works perfectly.

    Awesome. I can go and code player control logic for my game now

  • This is awesome news, I can't wait to try this

  • I'm having some trouble

    It works awesomeLY, but for some reason when I try it in my game, it refuses to recognize controls by their name ("on control", etc)

    So.... halp? I really don't understand why it won't work here. I deleted everything in my game except for the bare minimum and it still won't work.

    http://octavoarte.cl/test.cap

  • Yeeh, I've got the arm part kinda figured out, and its a good idea, as you might want your players to map their own keys, but presetting controls is somewhat confusing.

  • I agree that preset thing is the most tricky part.

    First you create your preset with "Set control default component", then you activate the presets with "Init control default component device" with optional Joystick number to use, because as you have only one keyboard and one mouse, there may be not only one joystick.

    After some thinking, I agree that it's a bit too complicated and I should rework that.

    So, First, I will rename "Set control default component" to "Set control preset" and "Init control default component device" to "Set presets joystick"

    Then, I will change the preset like this:

    • call "Set control preset", will init control directly and if it's a joystick, it'll take the first one available.
    • call "Set presets joystick" to set joystick to use for preset and to change the used joystick of previous presets.

    What do you think?

  • Thanks for the clarification, and that does sound a bit easier to understand.

    I guess what I was missing was the set default.

    One other question, once you've set up the arm control, can you use "InputSystem.GetControlConfigData" for the next layout?

  • GetControlconfigData primary goal is to have a string representation of configured controls that can be used, for example, to save the configuration on disk (see Input System3.cap). Then you use SetControlConfigData to set controls.

    I didn't think of using this method to transfer controls data between two layouts, because I thought you'd rather have one InputSytem global to the application than one InputSystem for each Layout. So, it may and should work. If you try it, tell me if it's really working

  • I did the global thing and it works perfectly

    The change you mention sounds much clearer, although I can use it as it is with this clarification (yay!)

  • I did the global thing and it works perfectly

    The change you mention sounds much clearer, although I can use it as it is with this clarification (yay!)

    You should use last version, as actions' names have been modified in 0.91b.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)