App

Xcode from a game controller

Download InputConfig on the Mac App StoreThe Xcode layout is built into InputConfig, free on the Mac App Store. You don't have to make an account, there are no subscriptions, and nothing is locked. Optimized for Apple silicon.

On a Mac: Xcode reads its standard shortcuts from this layout like any keyboard. Nothing to change in Xcode's key bindings.

Yes, you can build, run and stop Xcode from a game controller on a Mac: Command B, Command R and Command Period sit on buttons, with save, find and undo beside them. The best use is testing your own controller game with the same pad in your hands, spotting a bug, stopping the run and building again without putting it down. The other is the usual one: hands that cannot use a keyboard for long, paired with dictation.

On this page: 7 sections
  1. The layout, control by control
  2. How the layout thinks
  3. If your game reads the pad too
  4. Tune it for Xcode
  5. Get it in two clicks
  6. Every binding, as a table
  7. Questions

The layout, control by control

Click a control. Labels:

How the layout thinks

  • Build and run. Build (Command B) on the bottom face button, Run (Command R) on the right, and Build again on the right bumper for people who hold the pad the other way.
  • Stop. Command Period on Options, where a thumb has to mean it.
  • Save, find, undo. Save on the left face button, Find on the top, Undo on the left bumper.
  • Move around. The sticks are pointer and scroll, the right trigger clicks, and D-pad up and down move a line.

There is a specific joy in fixing your controller game with the controller. Build, run and stop never need the keyboard.

If your game reads the pad too

Xcode gets the controller's buttons as keys only while the preset is active. A game that reads the controller itself through Apple's Game Controller framework still sees the pad when it is in front, so with this preset running, one press reaches both: the game reads A as jump while InputConfig sends Command B to the front app, which is now your game.

  • You: In the preset's Automation & Gaming Utilities, add Xcode under Activate when these apps are in front, and turn on automatic switching in Settings, Advanced.
  • InputConfig: Runs the preset only while Xcode is in front and steps aside when your game is.
  • Check: Run the game and press A. It jumps, and nothing builds.
The Automation and Gaming Utilities section of a preset in InputConfig, with an app listed under Activate when these apps are in front.
Figure 1. List Xcode here and the preset steps aside whenever your game is in front.

Add the Simulator to the same list if you want the build keys there too. A running preset doubles every press in a game that reads the pad, so let auto-switch keep them apart.

Tune it for Xcode

  • Test. Put Command U on the touchpad press.
  • Jump to definition. Put Control Command J behind a chord.
  • Navigator and inspector. Put Command 0 and Command Option 0 on the stick clicks.
  • Read the error aloud. Select the issue and the Speak Selection system function reads it, once Speak selection is on in System Settings, Accessibility, Spoken Content. Silly until you need it.

Test on the touchpad completes the loop. Build, run, test and stop, all from the pad you are testing with.

Get it in two clicks

  1. Get InputConfig free on the Mac App Store, open it, and click Smart Preset Maker on the welcome screen.
  2. Search for Xcode and pick it. The layout is created as a preset in your sidebar, named and ready.
  3. Press Activate. Every row can be changed afterwards: the editor's Scan button rebinds any control the moment you touch it.

Every binding, as a table

The Xcode preset in InputConfig, drawn on a DualSense Edge with each control labeled with the key or action it sends.
The Xcode preset drawn on a DualSense Edge in InputConfig's Live Visualizer. For example, Right trigger is labeled Click, and A / Cross is labeled Build (Cmd+B). Any other controller shows the same layout on its own drawing.
ControllerSendsWhat it does
Left stick leftMouse motion left (speed 16)Cursor left
Left stick rightMouse motion right (speed 16)Cursor right
Left stick upMouse motion up (speed 16)Cursor up
Left stick downMouse motion down (speed 16)Cursor down
Right stick downScroll downScroll down
Right stick upScroll upScroll up
Right triggerLeft clickClick
A / CrossCommand (Left), BBuild (Cmd+B)
B / CircleCommand (Left), RRun (Cmd+R)
X / SquareCommand (Left), SSave
Y / TriangleCommand (Left), FFind
LB / L1Command (Left), ZUndo
RB / R1Command (Left), BBuild
D-pad upUpLine up
D-pad downDownLine down
Start / OptionsCommand (Left), .Stop (Cmd+.)

Button names follow the Xbox / PlayStation pair shown in the editor, so A / Cross is the bottom face button on either pad. On a Switch Pro Controller the bottom button is labeled B; the mapping still fires on position.

Questions

Will the controller confuse my game while Xcode has it?

Only if the preset is running while the game is in front. Use auto-switch so the preset is on for Xcode and off for the game.

Does this work with the Simulator?

Yes. The Simulator is another app, so the same rule applies. List it with Xcode if you want the build keys there too.

Download InputConfig on the Mac App StoreCompletely free. You don't have to make an account, there are no subscriptions, and nothing is locked. Optimized for Apple silicon. Open source on GitHub.

Updated