mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00

commit ad365d4ee854971122f0e8cb9157ed44b3aac0d8 Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 17:19:57 2024 +0700 Fix not able to reconnect to WebSocket server when switching game commit ca9369318d4cbb831650e8ca631e7997dc7706cb Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 17:19:23 2024 +0700 Stop emulated MKB when losing pointer capture commit 8cca1a0554c46b8f61455e79d5b16f1dff9a8014 Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 17:17:42 2024 +0700 Allow fine-tuning maximum video bitrate commit 763d414d560d9d2aa6710fd60e3f80bf43a534d6 Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 08:13:56 2024 +0700 Update mouse settings commit d65c5ab4e4a33ed8ad13acf0a15c4bb5ace870eb Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 08:10:49 2024 +0700 Increase MKB dialog's bg opacity commit 3e72f2ad2700737c8148ef47629528954a606578 Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 08:02:57 2024 +0700 Show/hide MKB dialog properly commit e7786f36508e3aa843604d9886861930bada5d60 Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 07:47:21 2024 +0700 Fix connecting to WebSocket server when it's not ready commit 512d8c227a057e5c0399bf128bc1c52a88fcf853 Author: redphx <96280+redphx@users.noreply.github.com> Date: Wed May 29 07:18:06 2024 +0700 Fix arrow keys not working in Android app commit 0ce90f47f37d057d5a4fab0003e2bec8960d1eee Author: redphx <96280+redphx@users.noreply.github.com> Date: Tue May 28 17:36:56 2024 +0700 Set mouse's default sensitivities to 50 commit 16eb48660dd44497e16ca22343a880d9a2e53a30 Author: redphx <96280+redphx@users.noreply.github.com> Date: Tue May 28 17:33:37 2024 +0700 Allow emulated MKB feature in Android app commit c3d0e64f8502e19cd4f167fea4cdbdfc2e14b65e Author: redphx <96280+redphx@users.noreply.github.com> Date: Tue May 28 17:32:49 2024 +0700 Remove stick decay settings commit d289d2a0dea61a440c1bc6b9392920b8e6ab6298 Author: redphx <96280+redphx@users.noreply.github.com> Date: Tue May 28 17:21:39 2024 +0700 Remove stick decaying feature commit 76bd001d98bac53f757f4ae793b2850aad055007 Author: redphx <96280+redphx@users.noreply.github.com> Date: Tue May 28 17:21:14 2024 +0700 Update data structure commit c5d3c87da9e6624ebefb288f6d7c8d06dc00916b Author: redphx <96280+redphx@users.noreply.github.com> Date: Tue May 28 08:14:27 2024 +0700 Fix not toggling the MKB feature correctly commit 9615535cf0e4d4372e201aefb6f1231ddbc22536 Author: redphx <96280+redphx@users.noreply.github.com> Date: Mon May 27 20:51:57 2024 +0700 Handle mouse data from the app
103 lines
2.5 KiB
TypeScript
103 lines
2.5 KiB
TypeScript
import type { GamepadKeyNameType } from "@/types/mkb";
|
|
import { PrompFont } from "@/utils/prompt-font";
|
|
|
|
export enum GamepadKey {
|
|
A = 0,
|
|
B = 1,
|
|
X = 2,
|
|
Y = 3,
|
|
LB = 4,
|
|
RB = 5,
|
|
LT = 6,
|
|
RT = 7,
|
|
SELECT = 8,
|
|
START = 9,
|
|
L3 = 10,
|
|
R3 = 11,
|
|
UP = 12,
|
|
DOWN = 13,
|
|
LEFT = 14,
|
|
RIGHT = 15,
|
|
HOME = 16,
|
|
SHARE = 17,
|
|
|
|
LS_UP = 100,
|
|
LS_DOWN = 101,
|
|
LS_LEFT = 102,
|
|
LS_RIGHT = 103,
|
|
|
|
RS_UP = 200,
|
|
RS_DOWN = 201,
|
|
RS_LEFT = 202,
|
|
RS_RIGHT = 203,
|
|
};
|
|
|
|
|
|
export const GamepadKeyName: GamepadKeyNameType = {
|
|
[GamepadKey.A]: ['A', PrompFont.A],
|
|
[GamepadKey.B]: ['B', PrompFont.B],
|
|
[GamepadKey.X]: ['X', PrompFont.X],
|
|
[GamepadKey.Y]: ['Y', PrompFont.Y],
|
|
|
|
[GamepadKey.LB]: ['LB', PrompFont.LB],
|
|
[GamepadKey.RB]: ['RB', PrompFont.RB],
|
|
[GamepadKey.LT]: ['LT', PrompFont.LT],
|
|
[GamepadKey.RT]: ['RT', PrompFont.RT],
|
|
|
|
[GamepadKey.SELECT]: ['Select', PrompFont.SELECT],
|
|
[GamepadKey.START]: ['Start', PrompFont.START],
|
|
[GamepadKey.HOME]: ['Home', PrompFont.HOME],
|
|
|
|
[GamepadKey.UP]: ['D-Pad Up', PrompFont.UP],
|
|
[GamepadKey.DOWN]: ['D-Pad Down', PrompFont.DOWN],
|
|
[GamepadKey.LEFT]: ['D-Pad Left', PrompFont.LEFT],
|
|
[GamepadKey.RIGHT]: ['D-Pad Right', PrompFont.RIGHT],
|
|
|
|
[GamepadKey.L3]: ['L3', PrompFont.L3],
|
|
[GamepadKey.LS_UP]: ['Left Stick Up', PrompFont.LS_UP],
|
|
[GamepadKey.LS_DOWN]: ['Left Stick Down', PrompFont.LS_DOWN],
|
|
[GamepadKey.LS_LEFT]: ['Left Stick Left', PrompFont.LS_LEFT],
|
|
[GamepadKey.LS_RIGHT]: ['Left Stick Right', PrompFont.LS_RIGHT],
|
|
|
|
[GamepadKey.R3]: ['R3', PrompFont.R3],
|
|
[GamepadKey.RS_UP]: ['Right Stick Up', PrompFont.RS_UP],
|
|
[GamepadKey.RS_DOWN]: ['Right Stick Down', PrompFont.RS_DOWN],
|
|
[GamepadKey.RS_LEFT]: ['Right Stick Left', PrompFont.RS_LEFT],
|
|
[GamepadKey.RS_RIGHT]: ['Right Stick Right', PrompFont.RS_RIGHT],
|
|
};
|
|
|
|
|
|
export enum GamepadStick {
|
|
LEFT = 0,
|
|
RIGHT = 1,
|
|
};
|
|
|
|
export enum MouseButtonCode {
|
|
LEFT_CLICK = 'Mouse0',
|
|
RIGHT_CLICK = 'Mouse2',
|
|
MIDDLE_CLICK = 'Mouse1',
|
|
};
|
|
|
|
export enum MouseMapTo {
|
|
OFF = 0,
|
|
LS = 1,
|
|
RS = 2,
|
|
}
|
|
|
|
|
|
export enum WheelCode {
|
|
SCROLL_UP = 'ScrollUp',
|
|
SCROLL_DOWN = 'ScrollDown',
|
|
SCROLL_LEFT = 'ScrollLeft',
|
|
SCROLL_RIGHT = 'ScrollRight',
|
|
};
|
|
|
|
export enum MkbPresetKey {
|
|
MOUSE_MAP_TO = 'map_to',
|
|
|
|
MOUSE_SENSITIVITY_X = 'sensitivity_x',
|
|
MOUSE_SENSITIVITY_Y = 'sensitivity_y',
|
|
|
|
MOUSE_DEADZONE_COUNTERWEIGHT = 'deadzone_counterweight',
|
|
}
|