forked from mxstbr/karabiner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
disableKeyMapsOfProgram.ts
44 lines (42 loc) · 1.26 KB
/
disableKeyMapsOfProgram.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { KarabinerRules, From } from "./types";
function disableKeyMapOnProgram(
description: string,
appIdentifier: string,
from: From
): KarabinerRules {
return {
description,
manipulators: [
{
conditions: [
{
bundle_identifiers: [appIdentifier],
type: "frontmost_application_if",
},
],
type: "basic",
from,
to: [{ key_code: "f11" }],
},
],
};
}
export function createDisableKeyMapOnPrograms(): KarabinerRules[] {
return [
disableKeyMapOnProgram(
"Disable (Map to F11 which is harmless) Cmd-Q for Google Chrome due to frequently accidentally press",
"^com\\.google\\.Chrome$",
{ key_code: "w", modifiers: { mandatory: ["command", "left_shift"] } }
),
disableKeyMapOnProgram(
"Disable (Map to F11 which is harmless) Cmd-Q for Google Chrome due to frequently accidentally press",
"^com\\.google\\.Chrome$",
{ key_code: "Q", modifiers: { mandatory: ["command"] } }
),
disableKeyMapOnProgram(
"Disable (Map to F11 which is harmless) Cmd-Q for Terminal Emulator due to frequently accidentally press",
"^io\\.Alarcritty$",
{ key_code: "Q", modifiers: { mandatory: ["command"] } }
),
];
}