提交 76b62dec 编写于 作者: A Alex Dima

const enum KeyMod (inline)

上级 262c0afa
......@@ -427,6 +427,17 @@ const enum BinaryKeybindingsMask {
KeyCode = 0x00000fff
}
export const enum KeyMod {
CtrlCmd = 1 << 15,
Shift = 1 << 14,
Alt = 1 << 13,
WinCtrl = 1 << 12,
}
export function KeyChord(firstPart:number, secondPart:number): number {
return firstPart | ((secondPart & 0x0000ffff) << 16);
}
export class BinaryKeybindings {
public static extractFirstPart(keybinding:number): number {
......@@ -462,19 +473,6 @@ export class BinaryKeybindings {
}
}
export class KeyMod {
public static CtrlCmd:number = BinaryKeybindingsMask.CtrlCmd;
public static Shift:number = BinaryKeybindingsMask.Shift;
public static Alt:number = BinaryKeybindingsMask.Alt;
public static WinCtrl:number = BinaryKeybindingsMask.WinCtrl;
}
export function KeyChord(firstPart:number, secondPart:number): number {
return firstPart | ((secondPart & 0x0000ffff) << 16);
}
/**
* A set of usual keybindings that can be reused in code
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册