mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-12-03 05:10:04 +01:00
Fix browser hotkeys not working
CTRL+C for copying text CTRL+F for focusing search box above chat log CTRL+SHIFT+I for inspector tools
This commit is contained in:
1 parent
b677f17bc7
commit
8ed9db1334
3 files changed
+15
-3
No files matched your search
+11
-1
@@ -175,6 +175,7 @@ export class PonyTownGame implements Game {
|
||||
shadowColor = SHADOW_COLOR;
|
||||
onChat = new Subject<void>();
|
||||
onToggleChat = new Subject<void>();
|
||||
onSearch = new Subject<void>();
|
||||
onCommand = new Subject<void>();
|
||||
onCancel = () => false;
|
||||
onClock = new BehaviorSubject<string>('');
|
||||
@@ -458,7 +459,16 @@ export class PonyTownGame implements Game {
|
||||
interact(this, this.input.isPressed(Key.SHIFT));
|
||||
});
|
||||
this.input.onPressed([Key.KEY_X, Key.GAMEPAD_BUTTON_DOWN], () => downAction(this));
|
||||
this.input.onPressed([Key.KEY_C, Key.GAMEPAD_BUTTON_UP], () => upAction(this));
|
||||
this.input.onPressed([Key.KEY_C, Key.GAMEPAD_BUTTON_UP], () => {
|
||||
if (!this.input.isPressed(Key.CTRL)) {
|
||||
upAction(this);
|
||||
}
|
||||
});
|
||||
this.input.onPressed(Key.KEY_F, () => {
|
||||
if (this.input.isPressed(Key.CTRL)) {
|
||||
this.onSearch.next();
|
||||
}
|
||||
});
|
||||
this.input.onPressed(Key.F2, () => {
|
||||
if (!this.settings.browser.disableFKeys) {
|
||||
this.hideText = !this.hideText;
|
||||
|
||||
@@ -9,7 +9,7 @@ function isKeyEventInvalid(e: KeyboardEvent) {
|
||||
}
|
||||
|
||||
function allowKey(key: number) {
|
||||
return key === Key.ESCAPE || key === Key.F5 || key === Key.F12 || key === Key.F11 || key === Key.TAB;
|
||||
return key === Key.ESCAPE || key === Key.F5 || key === Key.F12 || key === Key.F11 || key === Key.TAB || key === Key.KEY_C || key === Key.KEY_I;
|
||||
}
|
||||
|
||||
function fixKeyCode(key: number) {
|
||||
|
||||
Reference in new issue
Block a user