sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget!/translations/zh_CN/input/gamepadmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/zh_TW/input/gamepadmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/it_IT/input/gamepadmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/ja_JP/input/gamepadmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/ko_KR/input/gamepadmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget!/translations/sp_SP/input/gamepadmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hLinux Gamepad Specificationh]hLinux Gamepad Specification}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh;/var/lib/git/docbuild/linux/Documentation/input/gamepad.rsthKubh field_list)}(hhh]hfield)}(hhh](h field_name)}(hAuthorh]hAuthor}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(h02013 by David Herrmann h]h paragraph)}(h.2013 by David Herrmann h](h2013 by David Herrmann <}(hhhhhNhNubh reference)}(hdh.herrmann@gmail.comh]hdh.herrmann@gmail.com}(hhhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:dh.herrmann@gmail.comuh1hhhubh>}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Introductionh]h Introduction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK ubh)}(hLinux provides many different input drivers for gamepad hardware. To avoid having user-space deal with different button-mappings for each gamepad, this document defines how gamepads are supposed to report their data.h]hLinux provides many different input drivers for gamepad hardware. To avoid having user-space deal with different button-mappings for each gamepad, this document defines how gamepads are supposed to report their data.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjhhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hGeometryh]hGeometry}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6hhhhhKubh)}(h=As "gamepad" we define devices which roughly look like this::h]h@As “gamepad” we define devices which roughly look like this:}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubh literal_block)}(hX ____________________________ __ / [__ZL__] [__ZR__] \ | / [__ TL __] [__ TR __] \ | Front Triggers __/________________________________\__ __| / _ \ | / /\ __ (N) \ | / || __ |MO| __ _ _ \ | Main Pad | <===DP===> |SE| |ST| (W) -|- (E) | | \ || ___ ___ _ / | /\ \/ / \ / \ (S) /\ __| / \________ | LS | ____ | RS | ________/ \ | | / \ \___/ / \ \___/ / \ | | Control Sticks | / \_____/ \_____/ \ | __| | / \ | \_____/ \_____/ |________|______| |______|___________| D-Pad Left Right Action Pad Stick Stick |_____________| Menu Padh]hX ____________________________ __ / [__ZL__] [__ZR__] \ | / [__ TL __] [__ TR __] \ | Front Triggers __/________________________________\__ __| / _ \ | / /\ __ (N) \ | / || __ |MO| __ _ _ \ | Main Pad | <===DP===> |SE| |ST| (W) -|- (E) | | \ || ___ ___ _ / | /\ \/ / \ / \ (S) /\ __| / \________ | LS | ____ | RS | ________/ \ | | / \ \___/ / \ \___/ / \ | | Control Sticks | / \_____/ \_____/ \ | __| | / \ | \_____/ \_____/ |________|______| |______|___________| D-Pad Left Right Action Pad Stick Stick |_____________| Menu Pad}hjWsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jUhhhKhj6hhubh)}(h*Most gamepads have the following features:h]h*Most gamepads have the following features:}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hj6hhubh block_quote)}(hXH- Action-Pad 4 buttons in diamonds-shape (on the right side). The buttons are differently labeled on most devices so we define them as NORTH, SOUTH, WEST and EAST. - D-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right. - Menu-Pad Different constellations, but most-times 2 buttons: SELECT - START Furthermore, many gamepads have a fancy branded button that is used as special system-button. It often looks different to the other buttons and is used to pop up system-menus or system-settings. - Analog-Sticks Analog-sticks provide freely moveable sticks to control directions. Not all devices have both or any, but they are present at most times. Analog-sticks may also provide a digital button if you press them. - Triggers Triggers are located on the upper-side of the pad in vertical direction. Not all devices provide them, but the upper buttons are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right. - Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors. h]h bullet_list)}(hhh](h list_item)}(hAction-Pad 4 buttons in diamonds-shape (on the right side). The buttons are differently labeled on most devices so we define them as NORTH, SOUTH, WEST and EAST.h]h)}(hAction-Pad 4 buttons in diamonds-shape (on the right side). The buttons are differently labeled on most devices so we define them as NORTH, SOUTH, WEST and EAST.h]hAction-Pad 4 buttons in diamonds-shape (on the right side). The buttons are differently labeled on most devices so we define them as NORTH, SOUTH, WEST and EAST.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubah}(h]h ]h"]h$]h&]uh1jhj}ubj)}(hWD-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right.h]h)}(hWD-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right.h]hWD-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjubah}(h]h ]h"]h$]h&]uh1jhj}ubj)}(hXMenu-Pad Different constellations, but most-times 2 buttons: SELECT - START Furthermore, many gamepads have a fancy branded button that is used as special system-button. It often looks different to the other buttons and is used to pop up system-menus or system-settings.h]h)}(hXMenu-Pad Different constellations, but most-times 2 buttons: SELECT - START Furthermore, many gamepads have a fancy branded button that is used as special system-button. It often looks different to the other buttons and is used to pop up system-menus or system-settings.h]hXMenu-Pad Different constellations, but most-times 2 buttons: SELECT - START Furthermore, many gamepads have a fancy branded button that is used as special system-button. It often looks different to the other buttons and is used to pop up system-menus or system-settings.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1jhj}ubj)}(hAnalog-Sticks Analog-sticks provide freely moveable sticks to control directions. Not all devices have both or any, but they are present at most times. Analog-sticks may also provide a digital button if you press them.h]h)}(hAnalog-Sticks Analog-sticks provide freely moveable sticks to control directions. Not all devices have both or any, but they are present at most times. Analog-sticks may also provide a digital button if you press them.h]hAnalog-Sticks Analog-sticks provide freely moveable sticks to control directions. Not all devices have both or any, but they are present at most times. Analog-sticks may also provide a digital button if you press them.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1jhj}ubj)}(hTriggers Triggers are located on the upper-side of the pad in vertical direction. Not all devices provide them, but the upper buttons are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right.h]h)}(hTriggers Triggers are located on the upper-side of the pad in vertical direction. Not all devices provide them, but the upper buttons are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right.h]hTriggers Triggers are located on the upper-side of the pad in vertical direction. Not all devices provide them, but the upper buttons are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1jhj}ubj)}(h_Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors. h]h)}(h^Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors.h]h^Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]bullet-uh1j{hhhK+hjwubah}(h]h ]h"]h$]h&]uh1juhhhK+hj6hhubeh}(h]geometryah ]h"]geometryah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Detectionh]h Detection}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhKCubh)}(hX3All gamepads that follow the protocol described here map BTN_GAMEPAD. This is an alias for BTN_SOUTH/BTN_A. It can be used to identify a gamepad as such. However, not all gamepads provide all features, so you need to test for all features that you need, first. How each feature is mapped is described below.h]hX3All gamepads that follow the protocol described here map BTN_GAMEPAD. This is an alias for BTN_SOUTH/BTN_A. It can be used to identify a gamepad as such. However, not all gamepads provide all features, so you need to test for all features that you need, first. How each feature is mapped is described below.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhj(hhubh)}(hXLegacy drivers often don't comply to these rules. As we cannot change them for backwards-compatibility reasons, you need to provide fixup mappings in user-space yourself. Some of them might also provide module-options that change the mappings so you can advise users to set these.h]hXLegacy drivers often don’t comply to these rules. As we cannot change them for backwards-compatibility reasons, you need to provide fixup mappings in user-space yourself. Some of them might also provide module-options that change the mappings so you can advise users to set these.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhj(hhubh)}(haAll new gamepads are supposed to comply with this mapping. Please report any bugs, if they don't.h]hcAll new gamepads are supposed to comply with this mapping. Please report any bugs, if they don’t.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKOhj(hhubh)}(hX5There are a lot of less-featured/less-powerful devices out there, which re-use the buttons from this protocol. However, they try to do this in a compatible fashion. For example, the "Nintendo Wii Nunchuk" provides two trigger buttons and one analog stick. It reports them as if it were a gamepad with only one analog stick and two trigger buttons on the right side. But that means, that if you only support "real" gamepads, you must test devices for _all_ reported events that you need. Otherwise, you will also get devices that report a small subset of the events.h]hX=There are a lot of less-featured/less-powerful devices out there, which re-use the buttons from this protocol. However, they try to do this in a compatible fashion. For example, the “Nintendo Wii Nunchuk” provides two trigger buttons and one analog stick. It reports them as if it were a gamepad with only one analog stick and two trigger buttons on the right side. But that means, that if you only support “real” gamepads, you must test devices for _all_ reported events that you need. Otherwise, you will also get devices that report a small subset of the events.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhj(hhubh)}(hRNo other devices, that do not look/feel like a gamepad, shall report these events.h]hRNo other devices, that do not look/feel like a gamepad, shall report these events.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hj(hhubeh}(h] detectionah ]h"] detectionah$]h&]uh1hhhhhhhhKCubh)}(hhh](h)}(hEventsh]hEvents}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK_ubh)}(h%Gamepads report the following events:h]h%Gamepads report the following events:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjhhubj|)}(hhh](j)}(hXAction-Pad: Every gamepad device has at least 2 action buttons. This means, that every device reports BTN_SOUTH (which BTN_GAMEPAD is an alias for). Regardless of the labels on the buttons, the codes are sent according to the physical position of the buttons. Please note that 2- and 3-button pads are fairly rare and old. You might want to filter gamepads that do not report all four. - 2-Button Pad: If only 2 action-buttons are present, they are reported as BTN_SOUTH and BTN_EAST. For vertical layouts, the upper button is BTN_EAST. For horizontal layouts, the button more on the right is BTN_EAST. - 3-Button Pad: If only 3 action-buttons are present, they are reported as (from left to right): BTN_WEST, BTN_SOUTH, BTN_EAST If the buttons are aligned perfectly vertically, they are reported as (from top down): BTN_WEST, BTN_SOUTH, BTN_EAST - 4-Button Pad: If all 4 action-buttons are present, they can be aligned in two different formations. If diamond-shaped, they are reported as BTN_NORTH, BTN_WEST, BTN_SOUTH, BTN_EAST according to their physical location. If rectangular-shaped, the upper-left button is BTN_NORTH, lower-left is BTN_WEST, lower-right is BTN_SOUTH and upper-right is BTN_EAST. h](h)}(h Action-Pad:h]h Action-Pad:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchjubh)}(hEvery gamepad device has at least 2 action buttons. This means, that every device reports BTN_SOUTH (which BTN_GAMEPAD is an alias for). Regardless of the labels on the buttons, the codes are sent according to the physical position of the buttons.h]hEvery gamepad device has at least 2 action buttons. This means, that every device reports BTN_SOUTH (which BTN_GAMEPAD is an alias for). Regardless of the labels on the buttons, the codes are sent according to the physical position of the buttons.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubh)}(h}Please note that 2- and 3-button pads are fairly rare and old. You might want to filter gamepads that do not report all four.h]h}Please note that 2- and 3-button pads are fairly rare and old. You might want to filter gamepads that do not report all four.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjubjv)}(hXP- 2-Button Pad: If only 2 action-buttons are present, they are reported as BTN_SOUTH and BTN_EAST. For vertical layouts, the upper button is BTN_EAST. For horizontal layouts, the button more on the right is BTN_EAST. - 3-Button Pad: If only 3 action-buttons are present, they are reported as (from left to right): BTN_WEST, BTN_SOUTH, BTN_EAST If the buttons are aligned perfectly vertically, they are reported as (from top down): BTN_WEST, BTN_SOUTH, BTN_EAST - 4-Button Pad: If all 4 action-buttons are present, they can be aligned in two different formations. If diamond-shaped, they are reported as BTN_NORTH, BTN_WEST, BTN_SOUTH, BTN_EAST according to their physical location. If rectangular-shaped, the upper-left button is BTN_NORTH, lower-left is BTN_WEST, lower-right is BTN_SOUTH and upper-right is BTN_EAST. h]j|)}(hhh](j)}(h2-Button Pad: If only 2 action-buttons are present, they are reported as BTN_SOUTH and BTN_EAST. For vertical layouts, the upper button is BTN_EAST. For horizontal layouts, the button more on the right is BTN_EAST. h](h)}(h 2-Button Pad:h]h 2-Button Pad:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubh)}(hIf only 2 action-buttons are present, they are reported as BTN_SOUTH and BTN_EAST. For vertical layouts, the upper button is BTN_EAST. For horizontal layouts, the button more on the right is BTN_EAST.h]hIf only 2 action-buttons are present, they are reported as BTN_SOUTH and BTN_EAST. For vertical layouts, the upper button is BTN_EAST. For horizontal layouts, the button more on the right is BTN_EAST.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(h3-Button Pad: If only 3 action-buttons are present, they are reported as (from left to right): BTN_WEST, BTN_SOUTH, BTN_EAST If the buttons are aligned perfectly vertically, they are reported as (from top down): BTN_WEST, BTN_SOUTH, BTN_EAST h](h)}(h 3-Button Pad:h]h 3-Button Pad:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjubh)}(hIf only 3 action-buttons are present, they are reported as (from left to right): BTN_WEST, BTN_SOUTH, BTN_EAST If the buttons are aligned perfectly vertically, they are reported as (from top down): BTN_WEST, BTN_SOUTH, BTN_EASTh]hIf only 3 action-buttons are present, they are reported as (from left to right): BTN_WEST, BTN_SOUTH, BTN_EAST If the buttons are aligned perfectly vertically, they are reported as (from top down): BTN_WEST, BTN_SOUTH, BTN_EAST}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hXe4-Button Pad: If all 4 action-buttons are present, they can be aligned in two different formations. If diamond-shaped, they are reported as BTN_NORTH, BTN_WEST, BTN_SOUTH, BTN_EAST according to their physical location. If rectangular-shaped, the upper-left button is BTN_NORTH, lower-left is BTN_WEST, lower-right is BTN_SOUTH and upper-right is BTN_EAST. h](h)}(h 4-Button Pad:h]h 4-Button Pad:}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhj*ubh)}(hXUIf all 4 action-buttons are present, they can be aligned in two different formations. If diamond-shaped, they are reported as BTN_NORTH, BTN_WEST, BTN_SOUTH, BTN_EAST according to their physical location. If rectangular-shaped, the upper-left button is BTN_NORTH, lower-left is BTN_WEST, lower-right is BTN_SOUTH and upper-right is BTN_EAST.h]hXUIf all 4 action-buttons are present, they can be aligned in two different formations. If diamond-shaped, they are reported as BTN_NORTH, BTN_WEST, BTN_SOUTH, BTN_EAST according to their physical location. If rectangular-shaped, the upper-left button is BTN_NORTH, lower-left is BTN_WEST, lower-right is BTN_SOUTH and upper-right is BTN_EAST.}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hj*ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1j{hhhKmhjubah}(h]h ]h"]h$]h&]uh1juhhhKmhjubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXD-Pad: Every gamepad provides a D-Pad with four directions: Up, Down, Left, Right Some of these are available as digital buttons, some as analog buttons. Some may even report both. The kernel does not convert between these so applications should support both and choose what is more appropriate if both are reported. - Digital buttons are reported as: BTN_DPAD_* - Analog buttons are reported as: ABS_HAT0X and ABS_HAT0Y (for ABS values negative is left/up, positive is right/down) h](h)}(hD-Pad:h]hD-Pad:}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbubh)}(hX5Every gamepad provides a D-Pad with four directions: Up, Down, Left, Right Some of these are available as digital buttons, some as analog buttons. Some may even report both. The kernel does not convert between these so applications should support both and choose what is more appropriate if both are reported.h]hX5Every gamepad provides a D-Pad with four directions: Up, Down, Left, Right Some of these are available as digital buttons, some as analog buttons. Some may even report both. The kernel does not convert between these so applications should support both and choose what is more appropriate if both are reported.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbubjv)}(ho- Digital buttons are reported as: BTN_DPAD_* - Analog buttons are reported as: ABS_HAT0X and ABS_HAT0Y h]j|)}(hhh](j)}(h-Digital buttons are reported as: BTN_DPAD_* h](h)}(h Digital buttons are reported as:h]h Digital buttons are reported as:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h BTN_DPAD_*h]h BTN_DPAD_*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(h9Analog buttons are reported as: ABS_HAT0X and ABS_HAT0Y h](h)}(hAnalog buttons are reported as:h]hAnalog buttons are reported as:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hABS_HAT0X and ABS_HAT0Yh]hABS_HAT0X and ABS_HAT0Y}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1j{hhhKhjubah}(h]h ]h"]h$]h&]uh1juhhhKhjbubh)}(h<(for ABS values negative is left/up, positive is right/down)h]h<(for ABS values negative is left/up, positive is right/down)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hX_Analog-Sticks: The left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present. If analog-sticks provide digital buttons, they are mapped accordingly as BTN_THUMBL (first/left) and BTN_THUMBR (second/right). (for ABS values negative is left/up, positive is right/down) h](h)}(hAnalog-Sticks:h]hAnalog-Sticks:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hXThe left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present. If analog-sticks provide digital buttons, they are mapped accordingly as BTN_THUMBL (first/left) and BTN_THUMBR (second/right).h]hXThe left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present. If analog-sticks provide digital buttons, they are mapped accordingly as BTN_THUMBL (first/left) and BTN_THUMBR (second/right).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h<(for ABS values negative is left/up, positive is right/down)h]h<(for ABS values negative is left/up, positive is right/down)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hX>Triggers: Trigger buttons can be available as digital or analog buttons or both. User- space must correctly deal with any situation and choose the most appropriate mode. Upper trigger buttons are reported as BTN_TR or ABS_HAT1X (right) and BTN_TL or ABS_HAT1Y (left). Lower trigger buttons are reported as BTN_TR2 or ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL). If only one trigger-button combination is present (upper+lower), they are reported as "right" triggers (BTN_TR/ABS_HAT1X). (ABS trigger values start at 0, pressure is reported as positive values) h](h)}(h Triggers:h]h Triggers:}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj)ubh)}(hTrigger buttons can be available as digital or analog buttons or both. User- space must correctly deal with any situation and choose the most appropriate mode.h]hTrigger buttons can be available as digital or analog buttons or both. User- space must correctly deal with any situation and choose the most appropriate mode.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj)ubh)}(hUpper trigger buttons are reported as BTN_TR or ABS_HAT1X (right) and BTN_TL or ABS_HAT1Y (left). Lower trigger buttons are reported as BTN_TR2 or ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL).h]hUpper trigger buttons are reported as BTN_TR or ABS_HAT1X (right) and BTN_TL or ABS_HAT1Y (left). Lower trigger buttons are reported as BTN_TR2 or ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL).}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj)ubh)}(hzIf only one trigger-button combination is present (upper+lower), they are reported as "right" triggers (BTN_TR/ABS_HAT1X).h]h~If only one trigger-button combination is present (upper+lower), they are reported as “right” triggers (BTN_TR/ABS_HAT1X).}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj)ubh)}(hH(ABS trigger values start at 0, pressure is reported as positive values)h]hH(ABS trigger values start at 0, pressure is reported as positive values)}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj)ubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXMenu-Pad: Menu buttons are always digital and are mapped according to their location instead of their labels. That is: - 1-button Pad: Mapped as BTN_START - 2-button Pad: Left button mapped as BTN_SELECT, right button mapped as BTN_START Many pads also have a third button which is branded or has a special symbol and meaning. Such buttons are mapped as BTN_MODE. Examples are the Nintendo "HOME" button, the Xbox "X" button or the Sony PlayStation "PS" button. h](h)}(h Menu-Pad:h]h Menu-Pad:}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubh)}(hlMenu buttons are always digital and are mapped according to their location instead of their labels. That is:h]hlMenu buttons are always digital and are mapped according to their location instead of their labels. That is:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubjv)}(h~- 1-button Pad: Mapped as BTN_START - 2-button Pad: Left button mapped as BTN_SELECT, right button mapped as BTN_START h]j|)}(hhh](j)}(h#1-button Pad: Mapped as BTN_START h](h)}(h 1-button Pad:h]h 1-button Pad:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hMapped as BTN_STARTh]hMapped as BTN_START}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hR2-button Pad: Left button mapped as BTN_SELECT, right button mapped as BTN_START h](h)}(h 2-button Pad:h]h 2-button Pad:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hBLeft button mapped as BTN_SELECT, right button mapped as BTN_STARTh]hBLeft button mapped as BTN_SELECT, right button mapped as BTN_START}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1j{hhhKhjubah}(h]h ]h"]h$]h&]uh1juhhhKhjyubh)}(hMany pads also have a third button which is branded or has a special symbol and meaning. Such buttons are mapped as BTN_MODE. Examples are the Nintendo "HOME" button, the Xbox "X" button or the Sony PlayStation "PS" button.h]hMany pads also have a third button which is branded or has a special symbol and meaning. Such buttons are mapped as BTN_MODE. Examples are the Nintendo “HOME” button, the Xbox “X” button or the Sony PlayStation “PS” button.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h,Rumble: Rumble is advertised as FF_RUMBLE. h](h)}(hRumble:h]hRumble:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(h"Rumble is advertised as FF_RUMBLE.h]h"Rumble is advertised as FF_RUMBLE.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hProfile: Some pads provide a multi-value profile selection switch. An example is the XBox Adaptive and the XBox Elite 2 controllers. When the active profile is switched, its newly selected value is emitted as an ABS_PROFILE event.h](h)}(hProfile:h]hProfile:}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj2ubh)}(hSome pads provide a multi-value profile selection switch. An example is the XBox Adaptive and the XBox Elite 2 controllers. When the active profile is switched, its newly selected value is emitted as an ABS_PROFILE event.h]hSome pads provide a multi-value profile selection switch. An example is the XBox Adaptive and the XBox Elite 2 controllers. When the active profile is switched, its newly selected value is emitted as an ABS_PROFILE event.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj2ubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1j{hhhKchjhhubeh}(h]eventsah ]h"]eventsah$]h&]uh1hhhhhhhhK_ubeh}(h]linux-gamepad-specificationah ]h"]linux gamepad specificationah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jkjhj3j0j%j"jjjcj`u nametypes}(jkj3j%jjcuh}(jhhj0jj"j6jj(j`ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.