Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132929 views
License: OTHER
1
#!/usr/bin/env python
2
#
3
# Copyright 2019 the original author or authors.
4
#
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
# you may not use this file except in compliance with the License.
7
# You may obtain a copy of the License at
8
#
9
# http://www.apache.org/licenses/LICENSE-2.0
10
#
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
16
#
17
#
18
"""Gamepad button and axis mappings, currently specific to PS4 gamepads"""
19
20
BTN_X = 0 # PS4 gamepad is 3, PS3 gamepad is 2
21
BTN_Y = 3
22
BTN_A = 1 # PS4 gamepad is 1, PS3 gamepad is 3
23
BTN_B = 2
24
25
BTN_LEFT_BUMPER = 4
26
BTN_RIGHT_BUMPER = 5
27
28
BTN_LEFT_TRIGGER = 6
29
BTN_RIGHT_TRIGGER = 7
30
31
BTN_SELECT = 8
32
BTN_START = 9
33
34
BTN_LEFT_THUMB = 10
35
BTN_RIGHT_THUMB = 11
36
37
BTN_HOME = 12 # Not present on PS3
38
BTN_TOUCHPAD = 13 # Not present on PS3
39
40
AXIS_LEFT_THUMB_X = 0
41
AXIS_LEFT_THUMB_Y = 1
42
43
AXIS_RIGHT_THUMB_X = 2
44
AXIS_RIGHT_THUMB_Y = 3
45
46
AXIS_LEFT_TRIGGER = 4 # Not present on PS3
47
AXIS_RIGHT_TRIGGER = 5
48
49
50
51
52
53