0 Favourites

Custom Mouse Controls

  • For keyboard and gamepad objects, I can get the last key or button pressed and assign that input to a variable to customize controls. I can't seem to find any similar actions for the mouse object so I can't let a user change those inputs. Am I missing something or are there any workarounds for this?

    Thanks

    -Lou

  • Can you give an example of how you are currently assigning custom keys to your controls? It will be easier to see how best to integrate.

    Basically upon entering an "Assign key" state, add events for on left/right/middle mouse clicked - do something. This should be in parallel to your on keyboard key or button pressed.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I have global variables representing all the actions in my game, for example, key_jump. When the user wants to change controls, I wait for input using keyboard.LastKeyCode or gamepad.LastButton and assign that to key_jump. I then call those variables using keyboard.keycode or gamepad(0).buttonindex. That all works fine. However the mouse doesn't seem to have these features. I can't seem to assign an index of a mouse button to a variable. I then can't say on mouse index pressed - do something.

  • Sorry don't have an answer off the top of my head. I'll experiment a bit when I get the chance to see if there is anything that can be done.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
96 57,361
bitworks's avatar
bitworks
Unread hot topic
90 77,102
leonhard's avatar
leonhard
Unread hot topic
49 5,760
Ashley's avatar
Ashley Construct Team Founder