Input Events¶
Note
The Input Event system is gradually being supplemented by
Lua scripting. New automation is best written in Lua;
the .xci format described here remains fully supported for
button and key mapping.
Overview¶
The Input Event system maps hardware buttons, keyboard keys,
touch-screen labels, and external input devices to XCSoar actions.
Bindings are defined in plain-text .xci files and can be changed
without recompiling.
Key concepts:
Events – actions XCSoar can perform (zoom, pan, open a dialog, change a setting, etc.). A single input can trigger multiple events in sequence.
Modes – named states (
default,infobox,pan, or any custom name) that determine which set of bindings is active. This allows the same button to do different things depending on context, and enables hierarchical menus.Labels – on-screen button labels tied to modes, giving touch-screen users the same access as hardware-button users.
Glide Computer Events – events triggered automatically by the glide computer (e.g. flight-mode changes, takeoff, landing) rather than by user input.
Default configuration¶
The source file Data/Input/default.xci contains the built-in
bindings. It is compiled into XCSoar and also serves as a template
for custom files.
To use a custom file, go to
Menu > Config > System > Look > Language, Input > Events, select
your .xci file, and restart XCSoar.
Default key bindings¶
The built-in type=key mapping in Data/Input/default.xci
currently uses this grouped layout for F1 – F12:
F1 – F4 (safety / immediate cockpit use): quick access to immediate in-flight interactions (quick menu, checklist, FLARM traffic, airspace warnings).
F5 – F8 (navigation / task flow): lookup and task workflow actions (alternates, goto, target, task setup).
F9 – F12 (analysis / system views): analysis and status pages, plus basic setup.
Key |
Default event |
Group |
|---|---|---|
|
|
Safety / immediate cockpit use |
|
|
Safety / immediate cockpit use |
|
|
Safety / immediate cockpit use |
|
|
Safety / immediate cockpit use |
|
|
Navigation / task flow |
|
|
Navigation / task flow |
|
|
Navigation / task flow |
|
|
Navigation / task flow |
|
|
Analysis / system views |
|
|
Analysis / system views |
|
|
Analysis / system views |
|
|
Analysis / system views |
In mode=default, the number row currently uses this grouping:
3 and 5 (settings toggles): direct access to MC mode and ballast toggle.
6 – 9 (task workflow shortcuts): setup/basic task actions and waypoint/pilot-event actions.
0 (task control toggle): arm/disarm automatic waypoint advance.
Key |
Default event ( |
Group |
|---|---|---|
|
|
Settings toggles |
|
|
Settings toggles |
|
|
Task workflow shortcuts |
|
|
Task workflow shortcuts |
|
|
Task workflow shortcuts |
|
|
Task workflow shortcuts |
|
|
Task control toggle |
File format¶
A .xci file is plain text with CRLF line endings. Each record is
a group of key=value lines separated from the next record by a
blank line:
mode=default
type=key
data=APP1
event=StatusMessage My favorite settings are done
event=ScreenModes full
event=Sounds on
event=Zoom 1.0
event=Pan off
label=My Prefs
location=1
This example remaps the APP1 hardware key to disable pan, set zoom to 1.0, enable vario sounds, switch to full-screen mode, and display a confirmation message.
Event execution order¶
Events within a record are executed in reverse order (last listed
runs first). Place StatusMessage lines at the top of the event
list so they execute last and appear after all other actions have
completed.
Event list¶
Event |
Description |
|---|---|
|
Controls task abort and resume. Possible arguments: |
|
Opens the waypoint editor to create a new waypoint at the
current location. Use |
|
Adjusts the maximum ground temperature for convection forecast.
Possible arguments: |
|
Adjusts the Vega variometer filter time constant and
diagnostics. Possible arguments: |
|
Adjusts the active waypoint of the task. Possible arguments:
|
|
Toggles airspace display on the map. Possible arguments:
|
|
Controls the airspace display filter mode. Possible arguments:
|
|
Opens the airspace warnings dialog. |
|
Displays the analysis/statistics dialog. |
|
Controls waypoint advance trigger arming. Possible arguments:
|
|
Adjusts the audio deadband of internal vario sounds. Possible
arguments: |
|
Same as |
|
Adjusts the glider ballast setting. Possible arguments: |
|
Plays a beep sound. |
|
Adjusts screen brightness. (Not currently implemented.) |
|
Adjusts the bugs/degradation setting for glider performance.
Possible arguments: |
|
Opens the task manager dialog. |
|
Displays the checklist dialog. |
|
Acknowledges all active airspace warnings. |
|
Acknowledges and clears all status message warnings. |
|
Displays the credits dialog. |
|
Controls waypoint label display filtering. Possible arguments:
|
|
Device management. Possible arguments: |
|
Swaps the active and standby radio frequencies. |
|
Close XCSoar. |
|
Opens the file manager dialog. |
|
Opens the FLARM traffic list dialog. |
|
Controls the FLARM radar gauge display. Use |
|
Opens the full-screen FLARM traffic radar page. |
|
Opens the gesture help dialog showing available touch gestures. |
|
Opens the waypoint selector and sets the selected waypoint as a goto target. |
|
Displays the screen lock dialog. |
|
Activates the internal IGC logger.
|
|
Adjusts the MacCready setting. Possible arguments: |
|
Opens the main menu. |
|
Marks the current location and creates a user waypoint marker.
Use |
|
Sets the current input event mode. The argument is the label
of the mode to activate (e.g. |
|
If airspace warnings are active, opens the airspace warnings dialog. Otherwise, finds the nearest airspace (within 30 minutes flight time) and shows its details. |
|
Displays the map item list dialog for items near the current map position. |
|
Displays details for the nearest waypoint to the current map position. |
|
Does nothing. Can be used to override default functionality for a key/button. |
|
Sets the map orientation for circling mode. Possible arguments:
|
|
Sets the map orientation for cruise mode. Possible arguments:
|
|
Controls page navigation. Possible arguments: |
|
Control pan mode. Possible arguments: |
|
Announces a Pilot Event (PEV). Sets the PEV start time window based on the current task’s start constraints, logs the event to the IGC file, and notifies connected devices. |
|
Play the specified sound resource. |
|
Loads a profile from the specified file. |
|
Saves the current profile to the specified file. |
|
Opens the Quick Guide dialog. |
|
Opens the quick menu dialog. |
|
Repeats the last status message. If pressed repeatedly, will repeat previous status messages. |
|
Resets the current task. |
|
Runs an external program of the specified filename. Note that XCSoar will wait until this program exits. |
|
Runs a Lua script. If a |
|
Set the screen mode. Possible arguments: |
|
Sends a user-defined NMEA string to all Vega variometers. The
string is automatically prefixed with |
|
Sends a user-defined NMEA string to the device on port 1. |
|
Sends a user-defined NMEA string to the device on port 2. |
|
Activates configuration and setting dialogs.
|
|
Change snail trail setting. Possible arguments: |
|
Change vario sounds. Possible arguments: |
|
Displays one of the status dialogs. Possible arguments:
|
|
Display the specified status message text. |
|
Loads a task from the specified file. |
|
Saves the current task to the specified file. |
|
Displays task transition messages. Possible arguments:
|
|
Controls terrain and topography display. Possible arguments:
|
|
Deprecated alias for |
|
Opens the thermal assistant page. |
|
Controls the FLARM traffic radar widget. Possible arguments:
|
|
Opens a file picker to select an IGC file and uploads it to WeGlide. |
|
Forces a display mode. Possible arguments: |
|
Displays airfield/waypoint details.
|
|
Opens the waypoint editor/configuration dialog. |
|
Opens the weather dialog. |
|
Controls map zoom. Possible arguments: |
Modes¶
A mode is a named state that determines which bindings are active.
When XCSoar looks up a binding for an input, it first checks the
current mode and then falls back to default. This lets you
override a key for a specific context without affecting its behaviour
elsewhere.
A record’s mode field can list multiple modes separated by
spaces (e.g. mode=infobox menu1 menu2).
Built-in modes¶
default– the normal map view; active most of the time.infobox– an InfoBox has been selected.pan– pan mode is active.Menu– a menu level is open.
You may define any additional mode names to build custom menu hierarchies.
Labels¶
Each record can include a label and location to display an
on-screen button. Labels are passed through gettext for
translation. The number of label slots and their layout depend on the
device’s screen size.
Keys¶
The data field for type=key records accepts the following
values:
APP1–APP6: hardware application keysF1–F12: standard function keysLEFT,RIGHT,UP,DOWN,RETURN: directional and enter keysESCAPE,MENU,TAB: navigation keysA–Z,0–9: alphanumeric keys (case-insensitive)
Android:
BUTTON_R1,BUTTON_R2,BUTTON_L1,BUTTON_L2,BUTTON_A,BUTTON_B,BUTTON_C,BUTTON_X,BUTTON_Y,BUTTON_Z,MEDIA_NEXT,MEDIA_PREVIOUS,MEDIA_PLAY_PAUSE,VOLUME_UP,VOLUME_DOWN: gamepad and media keys for Bluetooth controllers
Windows:
F13–F20: extended function keys (e.g. Triadis RemoteStick)
Input types¶
key– a hardware or keyboard key press.gce– a Glide Computer Event (see below).nmea– a sentence received on an NMEA port.
Glide Computer Events¶
Glide Computer Events (GCEs) are triggered automatically by the glide
computer rather than by user input. They are defined with
type=gce and the event name in the data field. You can attach
the same actions to a GCE as to any other input – for example, play
a sound, display a message, or change the zoom level when entering a
thermal.
COMMPORT_RESTARTThe comm port has been restarted.
FLIGHTMODE_CLIMBThe flight mode has switched to “climb”.
FLIGHTMODE_CRUISEThe flight mode has switched to “cruise”.
FLIGHTMODE_FINALGLIDEThe flight mode has switched to “final glide”.
GPS_CONNECTION_WAITWaiting for the GPS connection.
GPS_FIX_WAITWaiting for a valid GPS fix.
HEIGHT_MAXMaximum height reached for this trip.
LANDINGLanding detected.
STARTUP_REALXCSoar has started in normal mode.
STARTUP_SIMULATORXCSoar has started in simulator mode.
TAKEOFFTakeoff detected.
AIRSPACE_NEARThe aircraft has approached an airspace for which warnings are enabled.
AIRSPACE_ENTERThe aircraft has entered an airspace for which warnings are enabled.