Native iPhone port of Factorio 2.0.77

Run the original macOS ARM64 game code on iOS:
- tools/retarget.py: header-only Mach-O retargeting to an iOS dylib
- platform/native: UIKit host and macOS API shims (AppKit for SDL's
  Cocoa backend, CoreGraphics displays, CoreAudio device, Metal device
  properties, Wuffs PNG decoding, Steam and peripheral stubs)
- touch, overlay, iOS keyboard and hardware keyboard input
- tools/build_native.py: build, sign, install, data copy, launch
- docs: build guide, controls, architecture

Also includes the earlier static-translation research (ARM64 -> WASM ->
native) under docs/research, runtime/, tests/ and tools/.

No game files are included; the build reads them from a local install.
This commit is contained in:
SashaGoncharov19 committed 2026-10-23 15:27:58 +04:00
commit 51d085e865
89 files changed
+7999

No files matched your search

+62
View File
@@ -0,0 +1,62 @@
# Controls
Factorio is played with a mouse and keyboard. The port turns touches into mouse events and
offers three ways to press keys. The game receives ordinary macOS key events with Mac key codes,
so Factorio's own key bindings and settings apply unchanged.
## Touch
| Gesture | Sent to the game | Typical use |
| --- | --- | --- |
| Tap | Left click (double tap = double click) | Buttons, placing, opening entities |
| Drag with one finger | Left button held while moving | Placing rows of items, dragging in GUIs |
| Long press (0.6 s) and keep holding | Right button held; moving drags with it | Mining resources, trees and rocks; removing buildings |
| Two-finger drag | Mouse wheel | Zooming the map view, scrolling lists |
Touch positions map 1:1 to the game's pixels, so taps land exactly under the finger.
## On-screen overlay
| Button | Key |
| --- | --- |
| Left stick | W A S D (walking); diagonals press two keys |
| E | Inventory |
| Q | Pipette / clear cursor |
| R | Rotate |
| F | Pick up items |
| M | Map |
| T | Technologies |
| ⇧ | Shift, sticky |
| Ctrl | Control, sticky |
| Esc (top left) | Escape: menu, close windows |
| Tab (top left) | Tab |
| ◐ (top right) | Hide or show the stick and the key buttons |
| ⌨︎ (top right) | Open or close the iOS keyboard |
The key labels match Factorio's default bindings. If you rebind keys in the game, the buttons
still send the same physical keys.
**Sticky modifiers.** Tap ⇧ or Ctrl and the button turns orange. The modifier stays pressed for
your next click, long press or typed key, then releases. Tap it again to release it without
using it. Example: Ctrl, then tap an assembler to transfer all items.
## iOS keyboard and extra keys
The ⌨︎ button opens the standard iOS keyboard for chat, save names and search fields. Every
character you type is also a key press, so letters work as hotkeys while the keyboard is open.
Above the keyboard is a scrollable bar with the keys iOS keyboards lack: Esc, Tab, Ctrl, Alt
and ⇧ (sticky), arrow keys, Enter, Del, \`, Home, End, Page Up, Page Down and F1–F12.
Typing uses the US key layout; accented characters are sent as text only.
## Hardware keyboard
A Bluetooth or USB-C keyboard is passed through key by key, including modifiers, function keys
and key releases, so held keys and combinations behave as on a Mac. iOS reserves some
Command-key shortcuts for itself.
## Interface size
At native resolution Factorio's interface is small on a phone. Set **Settings → Interface → UI
scale** in the game to about 175–200 %. This does not lower the rendering resolution.