Refactor getInstance() methods

This commit is contained in:
redphx
2024-10-14 16:56:05 +07:00
parent 9f440e9cf4
commit 927eae3f2f
12 changed files with 14 additions and 82 deletions

View File

@@ -23,6 +23,8 @@ type XcloudInputSink = {
export class NativeMkbHandler extends MkbHandler {
private static instance: NativeMkbHandler;
public static getInstance = () => NativeMkbHandler.instance ?? (NativeMkbHandler.instance = new NativeMkbHandler());
#pointerClient: PointerClient | undefined;
#enabled: boolean = false;
@@ -37,14 +39,6 @@ export class NativeMkbHandler extends MkbHandler {
#$message?: HTMLElement;
public static getInstance(): NativeMkbHandler {
if (!NativeMkbHandler.instance) {
NativeMkbHandler.instance = new NativeMkbHandler();
}
return NativeMkbHandler.instance;
}
#onKeyboardEvent(e: KeyboardEvent) {
if (e.type === 'keyup' && e.code === 'F8') {
e.preventDefault();