Skip to content

Joystick macros - #1370

Draft
sezanzeb wants to merge 6 commits into
mainfrom
joystick_macro
Draft

sezanzeb wants to merge 6 commits into
mainfrom
joystick_macro

Conversation

@sezanzeb

@sezanzeb sezanzeb commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Closes #875

Adds left_joystick, right_joystick, left_trigger, right_trigger, dpad_1, dpad_2, dpad_3 macros.

The mapping target needs to be "gamepad".

Mapping two keys to one of these will make them add their values up. Pressing and holding both left_joystick(1, 0) and left_joystick(-1, 0) together results in a neutral joystick position. Releasing one of them moves the joystick. Releasing both makes the joystick neutral again.

Examples:

left_joystick(1, 1)  # moves the joystick to the top right
right_joystick(-1, 0)  # moves the second joystick to the left
left_trigger(0.5)  # presses the left trigger halfway
# (similar to mouse_xy)

TODO:

  • tests
  • beta testers
  • docs

Open questions:

left_joystick() or joystick()?
dpad_1() or dpad()?

or joystick_1() and joystick_2()

Are these macros ok or does one of the alternatives look significantly better?

gamepad("left_joystick", x, y)
gamepad("right_joystick", x, y)
gamepad("left_trigger", z)
gamepad("dpad1", x, y)
left_joystick("up", 1)
dpad("right", 1)
dpad("down", 1)
# (Similar to the old mouse macro)

I think they would be harder to use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to bind keyboard keys as gamepad joystick axis?

1 participant