Skip to content

Mac: mouse as the right stick (camera and aiming) with mouse buttons on ZR/ZL, and a keyboard key map #2346

Open

Description

@VGioM

What is missing

On the Mac, the mouse is only the touch screen (front_mac.m: left button = finger 0) and the keyboard's right stick is Shift + arrow keys, which is all-or-nothing. In third-person shooters such as Red Dead Redemption (01007820196A6000), aiming and turning the camera with Shift + arrows is very imprecise, so playing with a keyboard and mouse is not really possible: the game needs a controller.

The keyboard layout is also fixed (WASD, J/K/U/I…). Because it reads key positions (keyCode), it already works on AZERTY (ZQSD), but a player cannot move a button to another key.

What you propose

An optional "mouse as right stick" mode for the Mac front end, off by default so touch-screen games keep working:

  • Mouse movement → right stick: the pointer is captured while the game window is key (CGAssociateMouseAndMouseCursorPosition(false) + raw deltas from NSEvent deltaX/deltaY), and each frame's movement becomes a right-stick deflection, with a sensitivity setting, an optional curve/dead zone, and the stick returning to centre when the mouse stops. Escape or losing focus releases the pointer, as input_release already does for held keys.
  • Left click → ZR, right click → ZL (fire / aim in most shooters), and the middle button or wheel to another button (e.g. R3).
  • Settings DM_MOUSE_STICK=1, DM_MOUSE_SENS=<n>, DM_MOUSE_BUTTONS=left=ZR,right=ZL,middle=RS, ideally listed in launcher.json so the launch window and front ends can show them. A game profile could turn the mode on by default where it makes sense (shooters), while games that use the touch screen keep the current behaviour.

Related, smaller: a key map setting, e.g. DM_KEYMAP=A=Space,B=E,ZR=…, using the same position-based key codes, so a player can rebind the keyboard.

Platforms

Mac

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgame: 01007820196A6000A game profilemacThe Mac front end and app (dm/mac, front_mac.m)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions