osx-jetbrains-keymap-generator 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osx-jetbrains-keymap-generator",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "generate autohotkeymap script from jetbrains keymap config for windows user",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -37,5 +37,6 @@
37
37
  "commander": "^8.2.0",
38
38
  "fast-xml-parser": "^3.20.3",
39
39
  "lodash": "^4.17.21"
40
- }
40
+ },
41
+ "files": ["dist"]
41
42
  }
package/.eslintrc.js DELETED
@@ -1,13 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parser: '@typescript-eslint/parser',
4
- plugins: [
5
- '@typescript-eslint',
6
- ],
7
- extends: [
8
- 'eslint:recommended',
9
- 'plugin:@typescript-eslint/recommended',
10
- 'prettier',
11
- 'plugin:node/recommended'
12
- ],
13
- };
@@ -1,754 +0,0 @@
1
- <keymap name="Mac OS X 10.5+" parent="$default" version="1" disable-mnemonics="true">
2
- <action id="FileChooser.TogglePathShowing">
3
- <keyboard-shortcut first-keystroke="meta P"/>
4
- </action>
5
-
6
- <action id="$Delete">
7
- <keyboard-shortcut first-keystroke="DELETE"/>
8
- <keyboard-shortcut first-keystroke="BACK_SPACE"/>
9
- <keyboard-shortcut first-keystroke="meta BACK_SPACE"/>
10
- </action>
11
-
12
- <action id="EditorDelete">
13
- <keyboard-shortcut first-keystroke="DELETE"/>
14
- </action>
15
-
16
- <action id="EditorBackSpace">
17
- <keyboard-shortcut first-keystroke="BACK_SPACE"/>
18
- <keyboard-shortcut first-keystroke="shift BACK_SPACE"/>
19
- </action>
20
-
21
- <action id="NextSplitter">
22
- <keyboard-shortcut first-keystroke="alt TAB"/>
23
- </action>
24
- <action id="PrevSplitter">
25
- <keyboard-shortcut first-keystroke="alt shift TAB"/>
26
- </action>
27
-
28
- <action id="ShowSettings">
29
- <keyboard-shortcut first-keystroke="meta COMMA"/>
30
- </action>
31
- <action id="ShowProjectStructureSettings">
32
- <keyboard-shortcut first-keystroke="meta SEMICOLON"/>
33
- </action>
34
- <action id="EditorChooseLookupItemDot">
35
- <keyboard-shortcut first-keystroke="control PERIOD"/>
36
- </action>
37
- <action id="CodeCompletion">
38
- <keyboard-shortcut first-keystroke="control SPACE"/>
39
- </action>
40
- <action id="ClassNameCompletion">
41
- <keyboard-shortcut first-keystroke="control alt SPACE"/>
42
- </action>
43
- <action id="SmartTypeCompletion">
44
- <keyboard-shortcut first-keystroke="control shift SPACE"/>
45
- </action>
46
- <action id="PreviousEditorTab">
47
- <keyboard-shortcut first-keystroke="control shift LEFT"/>
48
- </action>
49
- <action id="EditorPreviousWord">
50
- <keyboard-shortcut first-keystroke="alt LEFT"/>
51
- <keyboard-shortcut first-keystroke="control alt B"/>
52
- </action>
53
- <action id="QuickJavaDoc">
54
- <keyboard-shortcut first-keystroke="F1"/>
55
- <keyboard-shortcut first-keystroke="control J"/>
56
- <mouse-shortcut keystroke="control button2"/>
57
- </action>
58
- <action id="ToggleRenderedDocPresentation">
59
- <keyboard-shortcut first-keystroke="control alt Q"/>
60
- </action>
61
- <action id="ExpressionTypeInfo">
62
- <keyboard-shortcut first-keystroke="control shift P"/>
63
- </action>
64
- <action id="SafeDelete">
65
- <keyboard-shortcut first-keystroke="meta DELETE"/>
66
- </action>
67
- <action id="EditorDeleteToWordStart">
68
- <keyboard-shortcut first-keystroke="alt BACK_SPACE"/>
69
- </action>
70
- <action id="EditorDeleteToWordEnd">
71
- <keyboard-shortcut first-keystroke="alt DELETE"/>
72
- </action>
73
- <action id="DebugClass"/>
74
- <action id="EditorStartNewLine">
75
- <keyboard-shortcut first-keystroke="shift ENTER"/>
76
- </action>
77
- <action id="ExternalJavaDoc">
78
- <keyboard-shortcut first-keystroke="shift F1"/>
79
- </action>
80
- <action id="EditorContextInfo">
81
- <keyboard-shortcut first-keystroke="control shift Q"/>
82
- </action>
83
- <action id="MethodDown">
84
- </action>
85
- <action id="EditorPreviousWordWithSelection">
86
- <keyboard-shortcut first-keystroke="alt shift LEFT"/>
87
- <keyboard-shortcut first-keystroke="control alt shift B"/>
88
- </action>
89
- <action id="RunClass"/>
90
-
91
- <action id="GotoBookmark0">
92
- <keyboard-shortcut first-keystroke="control 0"/>
93
- </action>
94
- <action id="GotoBookmark1">
95
- <keyboard-shortcut first-keystroke="control 1"/>
96
- </action>
97
- <action id="GotoBookmark2">
98
- <keyboard-shortcut first-keystroke="control 2"/>
99
- </action>
100
- <action id="GotoBookmark3">
101
- <keyboard-shortcut first-keystroke="control 3"/>
102
- </action>
103
- <action id="GotoBookmark4">
104
- <keyboard-shortcut first-keystroke="control 4"/>
105
- </action>
106
- <action id="GotoBookmark5">
107
- <keyboard-shortcut first-keystroke="control 5"/>
108
- </action>
109
- <action id="GotoBookmark6">
110
- <keyboard-shortcut first-keystroke="control 6"/>
111
- </action>
112
- <action id="GotoBookmark7">
113
- <keyboard-shortcut first-keystroke="control 7"/>
114
- </action>
115
- <action id="GotoBookmark8">
116
- <keyboard-shortcut first-keystroke="control 8"/>
117
- </action>
118
- <action id="GotoBookmark9">
119
- <keyboard-shortcut first-keystroke="control 9"/>
120
- </action>
121
-
122
- <action id="ToggleBookmark0">
123
- <keyboard-shortcut first-keystroke="control shift 0"/>
124
- </action>
125
- <action id="ToggleBookmark1">
126
- <keyboard-shortcut first-keystroke="control shift 1"/>
127
- </action>
128
- <action id="ToggleBookmark2">
129
- <keyboard-shortcut first-keystroke="control shift 2"/>
130
- </action>
131
- <action id="ToggleBookmark3">
132
- <keyboard-shortcut first-keystroke="control shift 3"/>
133
- </action>
134
- <action id="ToggleBookmark4">
135
- <keyboard-shortcut first-keystroke="control shift 4"/>
136
- </action>
137
- <action id="ToggleBookmark5">
138
- <keyboard-shortcut first-keystroke="control shift 5"/>
139
- </action>
140
- <action id="ToggleBookmark6">
141
- <keyboard-shortcut first-keystroke="control shift 6"/>
142
- </action>
143
- <action id="ToggleBookmark7">
144
- <keyboard-shortcut first-keystroke="control shift 7"/>
145
- </action>
146
- <action id="ToggleBookmark8">
147
- <keyboard-shortcut first-keystroke="control shift 8"/>
148
- </action>
149
- <action id="ToggleBookmark9">
150
- <keyboard-shortcut first-keystroke="control shift 9"/>
151
- </action>
152
- <action id="MethodUp">
153
- <keyboard-shortcut first-keystroke="control UP"/>
154
- </action>
155
- <action id="ShowContent">
156
- <keyboard-shortcut first-keystroke="control shift DOWN"/>
157
- </action>
158
- <action id="NextEditorTab">
159
- <keyboard-shortcut first-keystroke="control shift RIGHT"/>
160
- </action>
161
- <action id="TogglePopupHints"/>
162
- <action id="EditorNextWordWithSelection">
163
- <keyboard-shortcut first-keystroke="alt shift RIGHT"/>
164
- <keyboard-shortcut first-keystroke="control alt shift F"/>
165
- </action>
166
- <action id="EditorNextWord">
167
- <keyboard-shortcut first-keystroke="alt RIGHT"/>
168
- <keyboard-shortcut first-keystroke="control alt F"/>
169
- </action>
170
- <action id="EditorLineStart">
171
- <keyboard-shortcut first-keystroke="HOME"/>
172
- <keyboard-shortcut first-keystroke="meta LEFT"/>
173
- </action>
174
- <action id="ValidateXml"/>
175
- <action id="TypeHierarchy">
176
- <keyboard-shortcut first-keystroke="control H"/>
177
- </action>
178
- <action id="ToggleReadOnlyAttribute"/>
179
- <action id="ShowPopupMenu"/>
180
- <action id="EditorLineStartWithSelection">
181
- <keyboard-shortcut first-keystroke="shift HOME"/>
182
- <keyboard-shortcut first-keystroke="meta shift LEFT"/>
183
- </action>
184
- <action id="ContextHelp">
185
- <keyboard-shortcut first-keystroke="meta shift F1"/>
186
- </action>
187
- <action id="NewElement">
188
- <keyboard-shortcut first-keystroke="meta N"/>
189
- <keyboard-shortcut first-keystroke="control ENTER"/>
190
- </action>
191
- <action id="NewElementSamePlace">
192
- <keyboard-shortcut first-keystroke="control alt N"/>
193
- </action>
194
- <action id="ActivateProjectToolWindow">
195
- <keyboard-shortcut first-keystroke="meta 1"/>
196
- </action>
197
- <action id="ActivateFavoritesToolWindow">
198
- <keyboard-shortcut first-keystroke="meta 2"/>
199
- </action>
200
- <action id="ActivateFindToolWindow">
201
- <keyboard-shortcut first-keystroke="meta 3"/>
202
- </action>
203
- <action id="ActivateRunToolWindow">
204
- <keyboard-shortcut first-keystroke="meta 4"/>
205
- </action>
206
- <action id="ActivateDebugToolWindow">
207
- <keyboard-shortcut first-keystroke="meta 5"/>
208
- </action>
209
- <action id="ActivateProblemsViewToolWindow">
210
- <keyboard-shortcut first-keystroke="meta 6"/>
211
- </action>
212
- <action id="ActivateStructureToolWindow">
213
- <keyboard-shortcut first-keystroke="meta 7"/>
214
- </action>
215
- <action id="ActivateHierarchyToolWindow"/>
216
- <action id="ActivateServicesToolWindow">
217
- <keyboard-shortcut first-keystroke="meta 8"/>
218
- </action>
219
- <action id="ActivateVersionControlToolWindow">
220
- <keyboard-shortcut first-keystroke="meta 9"/>
221
- </action>
222
- <action id="ActivateCommitToolWindow">
223
- <keyboard-shortcut first-keystroke="meta 0"/>
224
- </action>
225
- <action id="NextWindow">
226
- <keyboard-shortcut first-keystroke="meta BACK_QUOTE"/>
227
- </action>
228
- <action id="PreviousWindow">
229
- <keyboard-shortcut first-keystroke="meta shift BACK_QUOTE"/>
230
- </action>
231
- <action id="Generate">
232
- <keyboard-shortcut first-keystroke="meta N"/>
233
- <keyboard-shortcut first-keystroke="control ENTER"/>
234
- </action>
235
- <action id="EditorToggleColumnMode">
236
- <keyboard-shortcut first-keystroke="shift meta 8"/>
237
- <keyboard-shortcut first-keystroke="shift meta MULTIPLY"/>
238
- </action>
239
- <action id="EditorLineEndWithSelection">
240
- <keyboard-shortcut first-keystroke="shift END"/>
241
- <keyboard-shortcut first-keystroke="meta shift RIGHT"/>
242
- </action>
243
- <action id="ExportToTextFile">
244
- <keyboard-shortcut first-keystroke="control O"/>
245
- </action>
246
- <action id="EditorLineEnd">
247
- <keyboard-shortcut first-keystroke="END"/>
248
- <keyboard-shortcut first-keystroke="meta RIGHT"/>
249
- </action>
250
- <action id="Exit">
251
- <keyboard-shortcut first-keystroke="meta Q"/>
252
- </action>
253
- <action id="GotoDeclaration">
254
- <keyboard-shortcut first-keystroke="meta B"/>
255
- <mouse-shortcut keystroke="meta button1"/>
256
- <mouse-shortcut keystroke="Force touch" />
257
- <mouse-shortcut keystroke="button2" />
258
- </action>
259
- <action id="GotoTypeDeclaration">
260
- <keyboard-shortcut first-keystroke="meta shift B"/>
261
- <keyboard-shortcut first-keystroke="control shift B"/>
262
- <mouse-shortcut keystroke="meta shift button1"/>
263
- </action>
264
-
265
- <action id="EditorJoinLines">
266
- <keyboard-shortcut first-keystroke="control shift J"/>
267
- </action>
268
- <action id="FindNext">
269
- <keyboard-shortcut first-keystroke="F3"/>
270
- <keyboard-shortcut first-keystroke="control L"/>
271
- </action>
272
- <action id="FindPrevious">
273
- <keyboard-shortcut first-keystroke="shift F3"/>
274
- <keyboard-shortcut first-keystroke="control shift L"/>
275
- </action>
276
-
277
- <action id="VcsShowNextChangeMarker">
278
- <keyboard-shortcut first-keystroke="shift control alt DOWN"/>
279
- </action>
280
- <action id="VcsShowPrevChangeMarker">
281
- <keyboard-shortcut first-keystroke="shift control alt UP"/>
282
- </action>
283
- <action id="CallHierarchy">
284
- <keyboard-shortcut first-keystroke="control alt H"/>
285
- </action>
286
- <action id="Vcs.MoveChangedLinesToChangelist">
287
- <keyboard-shortcut first-keystroke="meta shift M"/>
288
- </action>
289
- <action id="ChangesView.Move">
290
- <keyboard-shortcut first-keystroke="meta shift M"/>
291
- </action>
292
-
293
- <action id="CommentByBlockComment">
294
- <keyboard-shortcut first-keystroke="meta alt SLASH"/>
295
- <keyboard-shortcut first-keystroke="meta alt DIVIDE"/>
296
- <keyboard-shortcut first-keystroke="control shift SLASH"/>
297
- <keyboard-shortcut first-keystroke="control shift DIVIDE"/>
298
- <keyboard-shortcut first-keystroke="meta shift SLASH"/>
299
- <keyboard-shortcut first-keystroke="meta shift DIVIDE"/>
300
- <keyboard-shortcut first-keystroke="meta shift DIVIDE"/>
301
- </action>
302
-
303
- <action id="Refresh">
304
- <keyboard-shortcut first-keystroke="meta R"/>
305
- </action>
306
- <action id="ForceRefresh">
307
- <keyboard-shortcut first-keystroke="meta alt shift R"/>
308
- </action>
309
- <action id="Rerun">
310
- <keyboard-shortcut first-keystroke="meta R"/>
311
- </action>
312
- <action id="RerunTests">
313
- <keyboard-shortcut first-keystroke="control meta R"/>
314
- <keyboard-shortcut first-keystroke="shift alt R"/>
315
- </action>
316
- <action id="RunClass">
317
- <keyboard-shortcut first-keystroke="control shift F10"/>
318
- </action>
319
- <action id="DebugClass">
320
- <keyboard-shortcut first-keystroke="control shift F9"/>
321
- </action>
322
- <action id="TestGestureAction">
323
- <keyboard-gesture-shortcut keystroke="meta 1" modifier="dblClick"/>
324
- </action>
325
- <action id="Switcher">
326
- <keyboard-shortcut first-keystroke="ctrl TAB"/>
327
- <keyboard-shortcut first-keystroke="ctrl shift TAB"/>
328
- </action>
329
- <action id="Diff.FocusOppositePane">
330
- <keyboard-shortcut first-keystroke="control TAB"/>
331
- </action>
332
- <action id="Diff.FocusOppositePaneAndScroll">
333
- <keyboard-shortcut first-keystroke="control shift TAB"/>
334
- </action>
335
- <action id="Vcs.QuickListPopupAction">
336
- <keyboard-shortcut first-keystroke="ctrl V"/>
337
- </action>
338
- <action id="VcsHistory.ShowAllAffected">
339
- <keyboard-shortcut first-keystroke="meta ctrl A"/>
340
- </action>
341
-
342
- <action id="EditorSelectWord">
343
- <keyboard-shortcut first-keystroke="alt UP"/>
344
- </action>
345
- <action id="EditorUnSelectWord">
346
- <keyboard-shortcut first-keystroke="alt DOWN"/>
347
- </action>
348
-
349
- <action id="EditorLookupUp">
350
- </action>
351
- <action id="EditorLookupDown">
352
- </action>
353
-
354
- <action id="EditorDeleteToWordStart">
355
- <keyboard-shortcut first-keystroke="alt BACK_SPACE"/>
356
- </action>
357
- <action id="EditorDeleteToWordEnd">
358
- <keyboard-shortcut first-keystroke="alt DELETE"/>
359
- </action>
360
- <action id="EditorDeleteLine">
361
- <keyboard-shortcut first-keystroke="meta BACK_SPACE"/>
362
- </action>
363
-
364
- <action id="CloseContent">
365
- <keyboard-shortcut first-keystroke="meta W"/>
366
- </action>
367
- <action id="CloseActiveTab">
368
- <keyboard-shortcut first-keystroke="control shift F4"/> <!-- TODO? -->
369
- </action>
370
-
371
-
372
- <action id="ReplaceInPath">
373
- <keyboard-shortcut first-keystroke="meta shift R"/>
374
- </action>
375
- <action id="FindInPath">
376
- <keyboard-shortcut first-keystroke="meta shift F"/>
377
- </action>
378
-
379
- <action id="Find">
380
- <keyboard-shortcut first-keystroke="meta F"/>
381
- </action>
382
- <action id="FindNext">
383
- <keyboard-shortcut first-keystroke="meta G"/>
384
- </action>
385
- <action id="FindPrevious">
386
- <keyboard-shortcut first-keystroke="meta shift G"/>
387
- </action>
388
-
389
- <action id="SelectNextOccurrence">
390
- <keyboard-shortcut first-keystroke="control G"/>
391
- </action>
392
- <action id="UnselectPreviousOccurrence">
393
- <keyboard-shortcut first-keystroke="control shift G"/>
394
- </action>
395
- <action id="SelectAllOccurrences">
396
- <keyboard-shortcut first-keystroke="meta control G"/>
397
- </action>
398
-
399
- <action id="Run">
400
- <keyboard-shortcut first-keystroke="control R"/>
401
- </action>
402
- <action id="Debug">
403
- <keyboard-shortcut first-keystroke="control D"/>
404
- </action>
405
- <action id="Resume">
406
- <keyboard-shortcut first-keystroke="meta alt R"/>
407
- <keyboard-shortcut first-keystroke="F9"/>
408
- </action>
409
-
410
- <action id="ChooseRunConfiguration">
411
- <keyboard-shortcut first-keystroke="control alt R"/>
412
- </action>
413
- <action id="ChooseDebugConfiguration">
414
- <keyboard-shortcut first-keystroke="control alt D"/>
415
- </action>
416
- <action id="RunClass">
417
- <keyboard-shortcut first-keystroke="control shift R"/>
418
- </action>
419
- <action id="DebugClass">
420
- <keyboard-shortcut first-keystroke="control shift D"/>
421
- </action>
422
-
423
- <action id="GotoClass">
424
- <keyboard-shortcut first-keystroke="meta O"/>
425
- </action>
426
- <action id="GotoChangedFile">
427
- <keyboard-shortcut first-keystroke="meta O"/>
428
- </action>
429
- <action id="GotoSymbol">
430
- <keyboard-shortcut first-keystroke="meta alt O"/>
431
- </action>
432
- <action id="GotoFile">
433
- <keyboard-shortcut first-keystroke="meta shift O"/>
434
- </action>
435
- <action id="GotoLine">
436
- <keyboard-shortcut first-keystroke="meta L"/>
437
- </action>
438
- <action id="GotoRelated">
439
- <keyboard-shortcut first-keystroke="control meta UP"/>
440
- </action>
441
- <action id="QuickImplementations">
442
- <keyboard-shortcut first-keystroke="alt SPACE"/>
443
- <keyboard-shortcut first-keystroke="meta Y"/>
444
- </action>
445
- <action id="EditSource">
446
- <keyboard-shortcut first-keystroke="meta DOWN"/>
447
- <keyboard-shortcut first-keystroke="F4"/>
448
- </action>
449
-
450
- <action id="ToggleBookmark">
451
- <keyboard-shortcut first-keystroke="F3"/>
452
- </action>
453
- <action id="ToggleBookmarkWithMnemonic">
454
- <keyboard-shortcut first-keystroke="alt F3"/>
455
- </action>
456
- <action id="ShowBookmarks">
457
- <keyboard-shortcut first-keystroke="meta F3"/>
458
- </action>
459
-
460
- <action id="ImplementMethods">
461
- <keyboard-shortcut first-keystroke="control I"/>
462
- </action>
463
- <action id="OverrideMethods">
464
- <keyboard-shortcut first-keystroke="control O"/>
465
- </action>
466
- <action id="OptimizeImports">
467
- <keyboard-shortcut first-keystroke="control alt O"/>
468
- </action>
469
- <action id="AutoIndentLines">
470
- <keyboard-shortcut first-keystroke="control alt I"/>
471
- </action>
472
-
473
- <action id="MinimizeCurrentWindow">
474
- <keyboard-shortcut first-keystroke="meta M"/>
475
- </action>
476
-
477
- <action id="ZoomCurrentWindow">
478
- <keyboard-shortcut first-keystroke="meta control EQUALS"/>
479
- </action>
480
-
481
- <action id="ToggleFullScreen">
482
- <keyboard-shortcut first-keystroke="meta control F"/>
483
- </action>
484
-
485
- <action id="Vcs.ToggleAmendCommitMode">
486
- <keyboard-shortcut first-keystroke="control alt M"/>
487
- </action>
488
- <action id="Vcs.ShowMessageHistory">
489
- <keyboard-shortcut first-keystroke="control M"/>
490
- <keyboard-shortcut first-keystroke="meta E"/>
491
- </action>
492
-
493
- <action id="ChangesView.SetDefault">
494
- <keyboard-shortcut first-keystroke="control SPACE" />
495
- </action>
496
-
497
- <action id="ShowNavBar">
498
- <keyboard-shortcut first-keystroke="meta UP"/>
499
- <keyboard-shortcut first-keystroke="alt HOME"/>
500
- </action>
501
-
502
- <action id="EditorScrollUp"/> <!-- Disables meta up -->
503
- <action id="EditorScrollDown"/> <!-- Disables meta down -->
504
- <action id="FindWordAtCaret"/> <!-- Disables meta F3 -->
505
- <action id="EditorScrollToCenter"/> <!-- Disables meta M -->
506
-
507
- <action id="$Undo">
508
- <keyboard-shortcut first-keystroke="meta Z"/> <!-- Disables alt backspace -->
509
- </action>
510
-
511
- <action id="QuickChangeScheme">
512
- <keyboard-shortcut first-keystroke="control BACK_QUOTE"/>
513
- </action>
514
-
515
- <action id="context.save"/>
516
- <action id="context.load"/>
517
-
518
- <action id="PreviousTab">
519
- <keyboard-shortcut first-keystroke="meta shift OPEN_BRACKET"/>
520
- <keyboard-shortcut first-keystroke="control LEFT"/>
521
- </action>
522
- <action id="NextTab">
523
- <keyboard-shortcut first-keystroke="meta shift CLOSE_BRACKET"/>
524
- <keyboard-shortcut first-keystroke="control RIGHT"/>
525
- </action>
526
- <action id="Diff.PrevChange">
527
- <keyboard-shortcut first-keystroke="meta shift OPEN_BRACKET"/>
528
- </action>
529
- <action id="Diff.NextChange">
530
- <keyboard-shortcut first-keystroke="meta shift CLOSE_BRACKET"/>
531
- </action>
532
- <action id="Diff.ApplyLeftSide">
533
- <keyboard-shortcut first-keystroke="control shift RIGHT"/>
534
- </action>
535
- <action id="Diff.ApplyRightSide">
536
- <keyboard-shortcut first-keystroke="control shift LEFT"/>
537
- </action>
538
- <action id="EditorCodeBlockStart">
539
- <keyboard-shortcut first-keystroke="meta alt OPEN_BRACKET"/>
540
- </action>
541
- <action id="EditorCodeBlockEnd">
542
- <keyboard-shortcut first-keystroke="meta alt CLOSE_BRACKET"/>
543
- </action>
544
- <action id="EditorCodeBlockStartWithSelection">
545
- <keyboard-shortcut first-keystroke="meta alt shift OPEN_BRACKET"/>
546
- </action>
547
- <action id="EditorCodeBlockEndWithSelection">
548
- <keyboard-shortcut first-keystroke="meta alt shift CLOSE_BRACKET"/>
549
- </action>
550
- <action id="Back">
551
- <keyboard-shortcut first-keystroke="meta OPEN_BRACKET"/>
552
- <keyboard-shortcut first-keystroke="meta alt LEFT"/>
553
- <mouse-shortcut keystroke="button4"/>
554
- </action>
555
- <action id="Forward">
556
- <keyboard-shortcut first-keystroke="meta CLOSE_BRACKET"/>
557
- <keyboard-shortcut first-keystroke="meta alt RIGHT"/>
558
- <mouse-shortcut keystroke="button5"/>
559
- </action>
560
-
561
- <action id="NextProjectWindow">
562
- <keyboard-shortcut first-keystroke="meta alt BACK_QUOTE"/>
563
- </action>
564
-
565
- <action id="PreviousProjectWindow">
566
- <keyboard-shortcut first-keystroke="meta shift alt BACK_QUOTE"/>
567
- </action>
568
-
569
- <action id="EditorCutLineEnd">
570
- <keyboard-shortcut first-keystroke="control K"/>
571
- </action>
572
- <action id="EditorDown">
573
- <keyboard-shortcut first-keystroke="DOWN"/>
574
- <keyboard-shortcut first-keystroke="control N"/>
575
- </action>
576
- <action id="EditorLeft">
577
- <keyboard-shortcut first-keystroke="LEFT"/>
578
- <keyboard-shortcut first-keystroke="control B"/>
579
- </action>
580
- <action id="EditorLineEnd">
581
- <keyboard-shortcut first-keystroke="END"/>
582
- <keyboard-shortcut first-keystroke="meta RIGHT"/>
583
- <keyboard-shortcut first-keystroke="control E"/>
584
- </action>
585
- <action id="EditorLineStart">
586
- <keyboard-shortcut first-keystroke="HOME"/>
587
- <keyboard-shortcut first-keystroke="meta LEFT"/>
588
- <keyboard-shortcut first-keystroke="control A"/>
589
- </action>
590
- <action id="EditorRight">
591
- <keyboard-shortcut first-keystroke="RIGHT"/>
592
- <keyboard-shortcut first-keystroke="control F"/>
593
- </action>
594
- <action id="EditorToggleColumnMode">
595
- <keyboard-shortcut first-keystroke="shift meta 8"/>
596
- </action>
597
- <action id="EditorUp">
598
- <keyboard-shortcut first-keystroke="UP"/>
599
- <keyboard-shortcut first-keystroke="control P"/>
600
- </action>
601
-
602
- <action id="UsageView.Include">
603
- <keyboard-shortcut first-keystroke="shift BACK_SPACE"/>
604
- </action>
605
-
606
- <action id="Refactorings.QuickListPopupAction">
607
- <keyboard-shortcut first-keystroke="control T"/>
608
- </action>
609
-
610
- <action id="NewScratchFile">
611
- <keyboard-shortcut first-keystroke="meta shift N"/>
612
- </action>
613
- <action id="ExpandAllToLevel1">
614
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="1"/>
615
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="NUMPAD1"/>
616
- </action>
617
- <action id="ExpandAllToLevel2">
618
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="2"/>
619
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="NUMPAD2"/>
620
- </action>
621
- <action id="ExpandAllToLevel3">
622
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="3"/>
623
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="NUMPAD3"/>
624
- </action>
625
- <action id="ExpandAllToLevel4">
626
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="4"/>
627
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="NUMPAD4"/>
628
- </action>
629
- <action id="ExpandAllToLevel5">
630
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="5"/>
631
- <keyboard-shortcut first-keystroke="meta alt MULTIPLY" second-keystroke="NUMPAD5"/>
632
- </action>
633
- <action id="EditorMatchBrace">
634
- <keyboard-shortcut first-keystroke="control M" replace-all="true"/>
635
- </action>
636
-
637
- <action id="EmojiAndSymbols">
638
- <keyboard-shortcut first-keystroke="control meta SPACE"/>
639
- </action>
640
-
641
- <action id="MethodOverloadSwitchUp">
642
- <keyboard-shortcut first-keystroke="alt UP"/>
643
- </action>
644
- <action id="MethodOverloadSwitchDown">
645
- <keyboard-shortcut first-keystroke="alt DOWN"/>
646
- </action>
647
-
648
- <action id="ServiceView.ShowServices">
649
- <keyboard-shortcut first-keystroke="shift meta T"/>
650
- </action>
651
-
652
- <action id="GotoNextElementUnderCaretUsage">
653
- <keyboard-shortcut first-keystroke="ctrl alt DOWN"/>
654
- </action>
655
-
656
- <action id="GotoPrevElementUnderCaretUsage">
657
- <keyboard-shortcut first-keystroke="ctrl alt UP"/>
658
- </action>
659
-
660
- <action id="XDebugger.AttachToProcess">
661
- <keyboard-shortcut first-keystroke="alt shift F5"/>
662
- </action>
663
- <action id="ShowFilterPopup">
664
- <keyboard-shortcut first-keystroke="control alt F"/>
665
- </action>
666
- <action id="ShowSearchHistory">
667
- <keyboard-shortcut first-keystroke="alt down"/>
668
- </action>
669
-
670
- <action id="SearchEverywhere.NavigateToNextGroup">
671
- <keyboard-shortcut first-keystroke="PAGE_DOWN"/>
672
- <keyboard-shortcut first-keystroke="meta DOWN"/>
673
- </action>
674
- <action id="SearchEverywhere.NavigateToPrevGroup">
675
- <keyboard-shortcut first-keystroke="PAGE_UP"/>
676
- <keyboard-shortcut first-keystroke="meta UP"/>
677
- </action>
678
-
679
- <action id="RunToCursor">
680
- <keyboard-shortcut first-keystroke="alt f9" />
681
- <mouse-shortcut keystroke="Force touch" />
682
- </action>
683
-
684
- <action id="ChangesView.GroupBy.Directory">
685
- <keyboard-shortcut first-keystroke="control P"/>
686
- </action>
687
- <action id="ChangesView.GroupBy.Module">
688
- <keyboard-shortcut first-keystroke="control M"/>
689
- </action>
690
-
691
- <action id="TodoViewGroupByShowModules">
692
- <keyboard-shortcut first-keystroke="control M"/>
693
- </action>
694
- <action id="TodoViewGroupByShowPackages">
695
- <keyboard-shortcut first-keystroke="control P"/>
696
- </action>
697
- <action id="TodoViewGroupByFlattenPackage">
698
- <keyboard-shortcut first-keystroke="control F"/>
699
- </action>
700
-
701
- <action id="ServiceView.GroupByContributor">
702
- <keyboard-shortcut first-keystroke="control T"/>
703
- </action>
704
- <action id="ServiceView.GroupByServiceGroups">
705
- <keyboard-shortcut first-keystroke="control P"/>
706
- </action>
707
- <action id="ToggleFindInSelection">
708
- <keyboard-shortcut first-keystroke="control alt E"/>
709
- </action>
710
-
711
- <action id="UsageGrouping.Module">
712
- <keyboard-shortcut first-keystroke="control M"/>
713
- </action>
714
- <action id="UsageGrouping.Directory">
715
- <keyboard-shortcut first-keystroke="control P"/>
716
- </action>
717
- <action id="UsageGrouping.UsageType">
718
- <keyboard-shortcut first-keystroke="control T"/>
719
- </action>
720
- <action id="UsageGrouping.FlattenModules">
721
- <keyboard-shortcut first-keystroke="control O"/>
722
- </action>
723
- <action id="UsageGrouping.FileStructure">
724
- <keyboard-shortcut first-keystroke="control S"/>
725
- </action>
726
- <action id="UsageGrouping.DirectoryStructure">
727
- <keyboard-shortcut first-keystroke="control D"/>
728
- </action>
729
-
730
- <action id="List-selectFirstRow">
731
- <keyboard-shortcut first-keystroke="alt up"/>
732
- </action>
733
- <action id="List-selectLastRow">
734
- <keyboard-shortcut first-keystroke="alt down"/>
735
- </action>
736
- <action id="List-selectFirstRowExtendSelection">
737
- <keyboard-shortcut first-keystroke="alt shift up"/>
738
- </action>
739
- <action id="List-selectLastRowExtendSelection">
740
- <keyboard-shortcut first-keystroke="alt shift down"/>
741
- </action>
742
- <action id="EditorScrollToCenter">
743
- <keyboard-shortcut first-keystroke="control L"/>
744
- </action>
745
- <action id="ActivateUnitTestsToolWindow">
746
- <keyboard-shortcut first-keystroke="meta alt 8"/>
747
- </action>
748
- <action id="ActivateNuGetToolWindow">
749
- <keyboard-shortcut first-keystroke="meta alt 7"/>
750
- </action>
751
- <action id="UiInspector">
752
- <mouse-shortcut keystroke="control alt button1"/>
753
- </action>
754
- </keymap>
@@ -1,29 +0,0 @@
1
- import {TranslateResult} from "./translator";
2
- import * as _ from "lodash";
3
-
4
- const splitter = '\n '
5
-
6
- export const print = (processName: string, translateResults: (string | TranslateResult)[]) => {
7
- const printOneLine = printTranslateResult(processName)
8
- return `
9
- LAlt::LWin
10
- LWin::LAlt
11
- #IfWinActive ahk_exe ${processName}
12
- {
13
- ${_.map(translateResults, r => printOneLine(r)).join(splitter)}
14
- }
15
- `
16
- }
17
-
18
- const printTranslateResult = (processName: string) => (translateResult: TranslateResult | string) => {
19
- if (typeof translateResult === 'string') {
20
- return `; ${translateResult}`
21
- }
22
- return `$${translateResult.left}::ControlSend ,,{Blind}${printRightResult(translateResult.right)},ahk_exe ${processName} ; ${translateResult.action}`
23
- }
24
-
25
- const printRightResult = (right: string[]) => {
26
- const downStrike = _.map(right, s => `{${s} down}`).join('')
27
- const upStrike = _.map(right.reverse(), s => `{${s} up}`).join('')
28
- return downStrike+upStrike
29
- }
@@ -1,53 +0,0 @@
1
- import _ = require("lodash");
2
-
3
- const keymapTable = {
4
- 'COMMA': ',',
5
- 'SEMICOLON': ';',
6
- 'SLASH': '/',
7
- 'PAGE_DOWN': 'PgDown',
8
- 'OPEN_BRACKET': '[',
9
- 'CLOSE_BRACKET': ']',
10
- 'ADD': '!=',
11
- 'MINUS': '-',
12
- 'SUBSTRATE': '-',
13
- 'meta': '#',
14
- 'control': '^',
15
- 'ctrl': '^',
16
- 'shift': '+',
17
- 'alt': '!',
18
- 'BACK_SPACE': 'Backspace',
19
- 'PAGE_UP': 'PgUp',
20
- 'DELETE': 'Del',
21
- 'EQUAL': '=',
22
- 'EQUALS': '=',
23
- 'DIVIDE': '/',
24
- 'BACK_QUOTE': '`',
25
- 'MULTIPLY': '*'
26
- }
27
-
28
- const allowedNormalKeys = new Set(['HOME', 'END', 'ENTER', 'TAB', 'SPACE', 'INSERT', 'RIGHT', 'LEFT', 'UP', 'DOWN'])
29
-
30
- const isAlphanumeric = (s: string) => /^[a-zA-Z0-9]$/.test(s)
31
-
32
- const isFunctionKey = (s: string) => /^F[1-2]*[0-9]$/.test(s)
33
-
34
- export const translateKey = (shortcut: string) => {
35
-
36
- if (keymapTable[shortcut]!=undefined) {
37
- return keymapTable[shortcut]
38
- }
39
-
40
- if (isAlphanumeric(shortcut)) {
41
- return shortcut.toLowerCase()
42
- }
43
-
44
- if (isFunctionKey(shortcut)) {
45
- return shortcut
46
- }
47
-
48
- if (allowedNormalKeys.has(shortcut)) {
49
- return _.capitalize(shortcut)
50
- }
51
-
52
- throw `unknown key: ${shortcut}`
53
- }
package/src/main.ts DELETED
@@ -1,38 +0,0 @@
1
- import * as fs from 'fs';
2
-
3
- import {translate} from "./translator";
4
- import {print} from "./ahk-script-printer";
5
- import {Command} from "commander";
6
- import {getParsedResult} from "./xmlParser";
7
-
8
-
9
- const keyGeneratorProgram = new Command()
10
- keyGeneratorProgram
11
- .usage('kmg [options]')
12
- .requiredOption('-f, --file <file>', 'path of jetbrains keymap xml file')
13
- .option('-e, --exec <exec>', 'windows process name that ahk need to send key strike to', 'java.exe')
14
- .option('-d, --destination <destination>', 'generated ahk script file location')
15
- .showSuggestionAfterError()
16
- .showHelpAfterError()
17
-
18
- keyGeneratorProgram.parse()
19
-
20
- const options = keyGeneratorProgram.opts()
21
-
22
- const keymapConfigReadStream = fs.readFileSync(options.file).toString()
23
-
24
- const translateResult = translate(getParsedResult(keymapConfigReadStream))
25
- const script = print(options.exec, translateResult)
26
-
27
-
28
- const destination = options.destination;
29
-
30
- if (destination) {
31
- if (fs.existsSync(destination) && fs.lstatSync(destination).isDirectory()) {
32
- throw `destination is directory: ${destination}`
33
- }
34
- console.info(`Generated file: ${destination}`)
35
- fs.writeFileSync(destination, script)
36
- } else {
37
- console.info(script)
38
- }
@@ -1,37 +0,0 @@
1
- import * as chai from "chai";
2
- import {print} from "../ahk-script-printer";
3
-
4
- chai.should()
5
-
6
- const expectedResult = (processName: string, ...results: string[]) => {
7
- return `
8
- LAlt::LWin
9
- LWin::LAlt
10
- #IfWinActive ahk_exe ${processName}
11
- {
12
- ${results.join('\n ')}
13
- }
14
- `
15
- }
16
-
17
-
18
- describe('printer tests', () => {
19
- it('should print result success', () => {
20
- const translateResult = [
21
- {action: 'first', left: '#k', right: ['LWin', 'k']},
22
- {action: 'second', left: '#+k', right: ['LWin', 'LShift','k']}
23
- ]
24
- const result = print('java.exe', translateResult)
25
- result.should.be.equal(expectedResult('java.exe',
26
- '$#k::ControlSend ,,{Blind}{LWin down}{k down}{k up}{LWin up},ahk_exe java.exe ; first',
27
- '$#+k::ControlSend ,,{Blind}{LWin down}{LShift down}{k down}{k up}{LShift up}{LWin up},ahk_exe java.exe ; second'
28
- ))
29
- })
30
- it('should print warning when translate result is error msg', () => {
31
- const translateResult = ['I am an error!']
32
- const result = print('java.exe', translateResult)
33
- result.should.be.equal(expectedResult('java.exe',
34
- '; I am an error!'
35
- ))
36
- })
37
- })
@@ -1,111 +0,0 @@
1
- import {translateKey} from "../hotkey-mapper";
2
- import * as chai from "chai";
3
- import {expect} from "chai";
4
-
5
- chai.should()
6
-
7
- describe('hotkey translator tests', () => {
8
- describe('should translate modifier keys success', ()=>{
9
- const modifierTranslationTable = [
10
- ['meta', '#'],
11
- ['control', '^'],
12
- ['shift', '+'],
13
- ['alt', '!'],
14
- ['ctrl', '^']
15
- ]
16
- modifierTranslationTable.forEach(([modifier, ahkHotkey]) => {
17
- it(`should translate ${modifier} to ${ahkHotkey} success`, () => {
18
- const result = translateKey(modifier)
19
- result.should.equal(ahkHotkey)
20
- });
21
- })
22
- })
23
-
24
- describe('should translate all alphanumeric keys to lowercase success', ()=>{
25
- const uppercaseAlphabetTranslations = [
26
- ['A', 'a'],
27
- ['B', 'b'],
28
- ['c', 'c'],
29
- ['5', '5']
30
- ]
31
- uppercaseAlphabetTranslations.forEach(([arrowKey, ahkHotkey]) => {
32
- it(`should translate ${arrowKey} to ${ahkHotkey} success`, () => {
33
- const result = translateKey(arrowKey)
34
- result.should.equal(ahkHotkey)
35
- });
36
- })
37
- })
38
-
39
- describe('should translate all other keys to success', ()=>{
40
- const uppercaseAlphabetTranslations = [
41
- ['LEFT', 'Left'],
42
- ['UP', 'Up'],
43
- ['DOWN', 'Down'],
44
- ['RIGHT', 'Right'],
45
- ['ENTER', 'Enter'],
46
- ['TAB', 'Tab'],
47
- ['SPACE', 'Space'],
48
- ]
49
- uppercaseAlphabetTranslations.forEach(([arrowKey, ahkHotkey]) => {
50
- it(`should translate ${arrowKey} to ${ahkHotkey} success`, () => {
51
- const result = translateKey(arrowKey)
52
- result.should.equal(ahkHotkey)
53
- });
54
- })
55
- })
56
-
57
- describe('should translate special defined keys success', ()=>{
58
- const specialDefinedKeys = [
59
- ['BACK_SPACE', 'Backspace'],
60
- ['DELETE', 'Del'],
61
- ['PAGE_UP', 'PgUp'],
62
- ['PAGE_DOWN', 'PgDown'],
63
- ]
64
- specialDefinedKeys.forEach(([specialDefinedKey, ahkHotkey]) => {
65
- it(`should translate ${specialDefinedKey} to ${ahkHotkey} success`, () => {
66
- const result = translateKey(specialDefinedKey)
67
- result.should.equal(ahkHotkey)
68
- });
69
- })
70
- })
71
-
72
- describe('should translate function keys success', ()=>{
73
- const specialDefinedKeys = [
74
- ['F1', 'F1'],
75
- ['F12', 'F12'],
76
- ]
77
- specialDefinedKeys.forEach(([specialDefinedKey, ahkHotkey]) => {
78
- it(`should translate ${specialDefinedKey} to ${ahkHotkey} success`, () => {
79
- const result = translateKey(specialDefinedKey)
80
- result.should.equal(ahkHotkey)
81
- });
82
- })
83
- })
84
-
85
- describe('should translate symbols success', () => {
86
- const symbolsTranslation = [
87
- ['COMMA', ','],
88
- ['SEMICOLON', ';'],
89
- ['SLASH', '/'],
90
- ['OPEN_BRACKET', '['],
91
- ['CLOSE_BRACKET', ']'],
92
- ['ADD', '!='],
93
- ['MINUS', '-'],
94
- ['SUBSTRATE', '-'],
95
- ['EQUAL', '='],
96
- ['BACK_QUOTE', '`'],
97
- ['MULTIPLY', '*'],
98
- ]
99
- symbolsTranslation.forEach(([symbol, ahkHotkey]) => {
100
- it(`should translate ${symbol} to ${ahkHotkey} success`, () => {
101
- const result = translateKey(symbol)
102
- result.should.equal(ahkHotkey)
103
- });
104
- })
105
- })
106
-
107
- it('should throw error if unknown key is passed', () => {
108
- const unknownKey = 'HELL'
109
- expect(() => translateKey(unknownKey)).to.throws(`unknown key: ${unknownKey}`)
110
- })
111
- })
@@ -1,61 +0,0 @@
1
- import * as chai from "chai";
2
- import {translate, TranslateResult} from "../translator";
3
-
4
- chai.should()
5
-
6
- describe('translator tests', () => {
7
- it('should translate key action to ahkscript instruction success with action name', () => {
8
- const keyAction = [{keys: ['meta', 'K', 'M', 'P'], action: 'test one'}]
9
- const result = translate(keyAction)
10
-
11
- result.length.should.equal(1)
12
- const target = result[0] as TranslateResult
13
- target.action.should.equal('test one')
14
- })
15
- it('should translate keys to left construction success', () => {
16
- const keyAction = [{keys: ['control', 'meta', 'shift', 'alt', 'K', 'M', 'P'], action: 'test one'}]
17
- const result = translate(keyAction)
18
-
19
- const target = result[0] as TranslateResult
20
- target.left.should.equal('^#+!kmp')
21
- })
22
- it('should translate modifier keys to right construction success', () => {
23
- const keyAction = [{keys: ['control', 'meta', 'shift', 'alt'], action: 'test one'}]
24
- const result = translate(keyAction)
25
-
26
- result.length.should.equal(1)
27
- const target = result[0] as TranslateResult
28
- target.right.should.eql(['LCtrl', 'LWin', 'LShift', 'LAlt'])
29
- })
30
- it('should translate other keys to right as hotkey mapper success', () => {
31
- const keyAction = [{keys: ['meta', 'K', 'UP', 'HOME'], action: 'test one'}]
32
- const result = translate(keyAction)
33
-
34
- const target = result[0] as TranslateResult
35
- target.right.should.eql(['LWin', 'k', 'Up', 'Home'])
36
- })
37
- it('should return error msg when keys contains unknown key', () => {
38
- const unknownKey = 'WrongKey'
39
- const action = 'test one';
40
- const unknownKeyAction = [{keys: ['WrongKey', 'K', 'UP', 'HOME'], action: action}]
41
- const result = translate(unknownKeyAction)
42
-
43
- const target = result[0] as string
44
- target.should.be.equal(`unknown key: ${unknownKey}, skip action: ${action}`)
45
- })
46
- it('should not map keys without meta or arrow keys', () => {
47
- const keyAction = [{keys: ['K', 'HOME'], action: 'skip one'}]
48
- const result = translate(keyAction)
49
-
50
- result.length.should.be.equal(0)
51
- })
52
- it('should translate constructions with same keys success', () => {
53
- const keyAction = [{keys: ['meta', 'K'], action: 'test one'}, {keys: ['meta', 'K'], action: 'test two'}]
54
- const result = translate(keyAction)
55
-
56
- result.length.should.be.equal(1)
57
- const target = result[0] as TranslateResult
58
- target.right.should.eql(['LWin', 'k'])
59
- target.action.should.eql('test one & test two')
60
- })
61
- })
package/src/translator.ts DELETED
@@ -1,48 +0,0 @@
1
- import * as _ from "lodash";
2
- import {translateKey} from "./hotkey-mapper";
3
-
4
- export interface KeyAction {
5
- keys: string[],
6
- action: string
7
- }
8
-
9
- const modifierMap = {
10
- '^': 'LCtrl',
11
- '!': 'LAlt',
12
- '+': 'LShift',
13
- '#': 'LWin'
14
- }
15
- export const ArrowKeys = ['UP', 'DOWN', 'RIGHT', 'LEFT']
16
- export const MetaKey = 'meta'
17
-
18
- export interface TranslateResult {
19
- action: string,
20
- left: string,
21
- right: string[]
22
- }
23
-
24
- const isMetaKeyOrArrowKey = (action:KeyAction) => action.keys.some(key => key === MetaKey || ArrowKeys.includes(key));
25
-
26
- export const translate: (actions: KeyAction[]) => (string | TranslateResult)[] = (actions: KeyAction[]) => {
27
-
28
- let ahkStore: { [Key: string]: TranslateResult } = {}
29
- const errStore: (string | TranslateResult)[] = []
30
-
31
- _.filter(actions, isMetaKeyOrArrowKey)
32
- .forEach((action) => {
33
- try {
34
- const translated = _.map(action.keys, (key) => translateKey(key))
35
- const left = translated.join('')
36
- if (ahkStore[left]) {
37
- ahkStore[left].action = `${ahkStore[left].action} & ${action.action}`
38
- } else {
39
- ahkStore[left] = {action: action.action, left: left, right: translateRight(translated)}
40
- }
41
- } catch (e) {
42
- errStore.push(`${e}, skip action: ${action.action}`)
43
- }
44
- })
45
- return [...Object.values(ahkStore),...errStore]
46
- }
47
-
48
- const translateRight = (translated: string[]) => _.map(translated, (key) => modifierMap[key] ?? key)
package/src/xmlParser.ts DELETED
@@ -1,39 +0,0 @@
1
- import * as parser from "fast-xml-parser";
2
- import * as _ from "lodash";
3
-
4
- type Shortcut = { '@_first-keystroke': string }
5
-
6
- type TargetKeymapItem = { 'keyboard-shortcut': Shortcut | Shortcut[] }
7
-
8
- type Keymap = { 'keymap': { 'action': [TargetKeymapItem | any] } }
9
-
10
- const parseOption = {
11
- ignoreAttributes: false,
12
- parseNodeValue: false,
13
- parseAttributeValue: true,
14
- trimValues: true,
15
- }
16
-
17
-
18
- export const getParsedResult = (rawXml: string) => {
19
- const parsedKeymap = parser.parse(rawXml, parseOption) as Keymap
20
-
21
- const actions = parsedKeymap.keymap.action;
22
-
23
- return _.chain(actions)
24
- .filter((action) => action['keyboard-shortcut'])
25
- .flatMap((action) =>
26
- _.map(tryConvertToCollection(action['keyboard-shortcut']),
27
- (key) => ({"keys": (key["@_first-keystroke"] as string).split(' '), "action": action['@_id'] as string})
28
- )
29
- ).value()
30
- }
31
-
32
- const tryConvertToCollection = <T>(input: T | T[]) => {
33
- if (Array.isArray(input)) {
34
- return input
35
- } else {
36
- return [input]
37
- }
38
- }
39
-
package/tsconfig.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "noImplicitAny": false,
6
- "removeComments": true,
7
- "noLib": false,
8
- "lib": ["es2017"],
9
- "emitDecoratorMetadata": true,
10
- "experimentalDecorators": true,
11
- "strictNullChecks": true,
12
- "target": "es6",
13
- "sourceMap": true,
14
- "allowJs": true,
15
- "outDir": "./dist",
16
- "importHelpers": true,
17
- "strict": true,
18
- "alwaysStrict": true,
19
- "noImplicitThis": true,
20
- "noUnusedLocals": true,
21
- "noUnusedParameters": true,
22
- "noImplicitReturns": true,
23
- "noFallthroughCasesInSwitch": true,
24
- },
25
- "include": [
26
- "src/**/*"
27
- ],
28
- "exclude": [
29
- "node_modules",
30
- "**/*.spec.ts"
31
- ]
32
- }