Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Latest commit

 

History

History
393 lines (373 loc) · 3.44 KB

Input.md

File metadata and controls

393 lines (373 loc) · 3.44 KB

Input

한국어

Config

Config/Input.json

{
    "ActionMap": { // For key presses and releases
        "Flash": [ // Action name
            {
                "Code": "Keycode.F", // "Code": "<type>.<code>"
                "Mods": ["Shift"] // Optional. Keys to should be pressed together.
            }
        ]
    },
    "AxisMap": { // For inputs that have a continuous range
        "LookUp": [
            {
                "Code": "MouseAxis.Y",
                "Scale": 1.0
            }
        ],
        "MoveForward": [
            {
                "Code": "Keycode.W",
                "Scale": 1.0
            },
            { // Can have multiple input codes
                "Code": "Keycode.S",
                "Scale": -1.0
            }
        ]
        // ...
    },
    "AxisConfig": {
        "CtrlAxis.leftx": {
            "DeadZone": 0.25,
            "Sensitivity": 1.0
        },
        // ...
    }
}

Binding

auto& input = AddComponent<InputComponent>();
input.BindAxis(u8"MoveForward", [this](Float f) { MoveForward(f); });
input.BindAxis(u8"LookUp", [this](Float f) { LookUp(f); });
input.BindAction(u8"Flash", /*pressed=*/true, [this]()
{
    light_.IsActive() ? light_.Deactivate() : light_.Activate();
});
// ...

Input code list

MouseBtn

L
M
R
X1
X2

MouseAxis

X
Y

CtrlBtn

a
b
x
y
back
guide
start
leftstick
rightstick
leftshoulder
rightshoulder
dpup
dpdown
dpleft
dpright

CtrlAxis

leftx
lefty
rightx
righty
lefttrigger
righttrigger

KeyMod

This is not input code. Used in ActionMap Mods option. Cannot be used as input code type.

Shift
Ctrl
Alt
GUI
Numlock
CapsLock
ModeSwitch

Keycode

Backspace
Tab
Return
Escape
Space
!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
CapsLock
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
PrintScreen
ScrollLock
Pause
Insert
Home
PageUp
Delete
End
PageDown
Right
Left
Down
Up
Numlock
Keypad /
Keypad *
Keypad -
Keypad +
Keypad Enter
Keypad 1
Keypad 2
Keypad 3
Keypad 4
Keypad 5
Keypad 6
Keypad 7
Keypad 8
Keypad 9
Keypad 0
Keypad .
Application
Power
Keypad =
F13
F14
F15
F16
F17
F18
F19
F20
F21
F22
F23
F24
Execute
Help
Menu
Select
Stop
Again
Undo
Cut
Copy
Paste
Find
Mute
VolumeUp
VolumeDown
Keypad ,
Keypad = (AS400)
AltErase
SysReq
Cancel
Clear
Prior
Return
Separator
Out
Oper
Clear / Again
CrSel
ExSel
Keypad 00
Keypad 000
ThousandsSeparator
DecimalSeparator
CurrencyUnit
CurrencySubUnit
Keypad (
Keypad )
Keypad {
Keypad }
Keypad Tab
Keypad Backspace
Keypad A
Keypad B
Keypad C
Keypad D
Keypad E
Keypad F
Keypad XOR
Keypad ^
Keypad %
Keypad <
Keypad >
Keypad &
Keypad &&
Keypad |
Keypad ||
Keypad :
Keypad #
Keypad Space
Keypad @
Keypad !
Keypad MemStore
Keypad MemRecall
Keypad MemClear
Keypad MemAdd
Keypad MemSubtract
Keypad MemMultiply
Keypad MemDivide
Keypad +/-
Keypad Clear
Keypad ClearEntry
Keypad Binary
Keypad Octal
Keypad Decimal
Keypad Hexadecimal
Left Ctrl
Left Shift
Left Alt
Left GUI
Right Ctrl
Right Shift
Right Alt
Right GUI
ModeSwitch
AudioNext
AudioPrev
AudioStop
AudioPlay
AudioMute
MediaSelect
WWW
Mail
Calculator
Computer
AC Search
AC Home
AC Back
AC Forward
AC Stop
AC Refresh
AC Bookmarks
BrightnessDown
BrightnessUp
DisplaySwitch
KBDIllumToggle
KBDIllumDown
KBDIllumUp
Eject
Sleep
App1
App2
AudioRewind
AudioFastForward