mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-05 20:58:27 +02:00
Add "Xbox button > Press" shortcut
This commit is contained in:
@@ -57,3 +57,36 @@ export function hasGamepad() {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function generateVirtualControllerMapping(override: {}={}) {
|
||||
const mapping = {
|
||||
GamepadIndex: 0,
|
||||
A: 0,
|
||||
B: 0,
|
||||
X: 0,
|
||||
Y: 0,
|
||||
LeftShoulder: 0,
|
||||
RightShoulder: 0,
|
||||
LeftTrigger: 0,
|
||||
RightTrigger: 0,
|
||||
View: 0,
|
||||
Menu: 0,
|
||||
LeftThumb: 0,
|
||||
RightThumb: 0,
|
||||
DPadUp: 0,
|
||||
DPadDown: 0,
|
||||
DPadLeft: 0,
|
||||
DPadRight: 0,
|
||||
Nexus: 0,
|
||||
LeftThumbXAxis: 0,
|
||||
LeftThumbYAxis: 0,
|
||||
RightThumbXAxis: 0,
|
||||
RightThumbYAxis: 0,
|
||||
PhysicalPhysicality: 0,
|
||||
VirtualPhysicality: 0,
|
||||
Dirty: false,
|
||||
Virtual: false,
|
||||
};
|
||||
|
||||
return Object.assign({}, mapping, override);
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ import { EmulatedMkbHandler } from "@/modules/mkb/mkb-handler";
|
||||
import { RendererShortcut } from "@/modules/shortcuts/renderer-shortcut";
|
||||
import { TrueAchievements } from "./true-achievements";
|
||||
import { NativeMkbHandler } from "@/modules/mkb/native-mkb-handler";
|
||||
import { VirtualControllerShortcut } from "@/modules/shortcuts/virtual-controller-shortcut";
|
||||
|
||||
export class ShortcutHandler {
|
||||
static runAction(action: ShortcutAction) {
|
||||
@@ -69,6 +70,10 @@ export class ShortcutHandler {
|
||||
case ShortcutAction.TRUE_ACHIEVEMENTS_OPEN:
|
||||
TrueAchievements.getInstance().open(false);
|
||||
break;
|
||||
|
||||
case ShortcutAction.CONTROLLER_XBOX_BUTTON_PRESS:
|
||||
VirtualControllerShortcut.pressXboxButton();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,6 +27,8 @@ export const SUPPORTED_LANGUAGES = {
|
||||
};
|
||||
|
||||
const Texts = {
|
||||
"button-xbox": "Xbox button",
|
||||
"press": "Press",
|
||||
"activate": "Activate",
|
||||
"activated": "Activated",
|
||||
"active": "Active",
|
||||
|
Reference in New Issue
Block a user