forked from evan-liu/karabiner.ts.examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
50 lines (44 loc) · 1.17 KB
/
index.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
45
46
47
48
49
50
import {
ifApp,
ifVar,
layer,
map,
mapDoubleTap,
NumberKeyValue,
rule,
simlayer,
withCondition,
withMapper,
writeToProfile,
} from 'karabiner.ts'
writeToProfile('--dry-run', [
simlayer('f', 'arrow-layer')
.options({ detect_key_down_uninterruptedly: true })
.manipulators([
withMapper<FromKeyParam, ToKeyParam>({
i: '↑',
j: '←',
l: '→',
k: '↓',
})((k, v) => map(k, undefined, 'any').to(v)),
withMapper<FromKeyParam, ToKeyParam>({
u: '←',
o: '→',
})((k, v) => map(k, undefined, 'any').to(v, 'left_control')),
]),
]);
/*
Karabiner-Elements profile parameters can also be set by the 3rd parameter
of writeToProfile('profileName', [ rules ], { params }). The default values are:
// Karabiner-Elements parameters
'basic.to_if_alone_timeout_milliseconds': 1000,
'basic.to_if_held_down_threshold_milliseconds': 500,
'basic.to_delayed_action_delay_milliseconds': 500,
'basic.simultaneous_threshold_milliseconds': 50,
'mouse_motion_to_scroll.speed': 100,
// karabiner.ts only parameters
// for simlayer()
'simlayer.threshold_milliseconds': 200
// for mapDoubleTap()
'double_tap.delay_milliseconds': 200,
*/