Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Js migration #1467

Merged
merged 30 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9bdd4a5
Update src/json/README
tekezo Aug 22, 2023
87fd520
src/json/multitouch_vi_mode.json.rb -> src/json/multitouch_vi_mode.js…
tekezo Aug 22, 2023
e9e7fa9
src/json/multitouch_diamond_cursor.json.rb -> src/json/multitouch_dia…
tekezo Aug 22, 2023
c7ec416
src/json/multitouch_mouse_buttons.json.rb -> src/json/multitouch_mous…
tekezo Aug 22, 2023
6d066a8
src/json/mouse_motion_to_scroll.json.rb -> src/json/mouse_motion_to_s…
tekezo Aug 22, 2023
c938654
Add const to karabiner
tekezo Aug 22, 2023
f30ce4e
src/json/mouse_keys_simple.json.erb -> src/json/mouse_keys_simple.jso…
tekezo Aug 22, 2023
eff33ba
src/json/mouse_keys_mode_v4.json.rb -> src/json/mouse_keys_mode_v4.js…
tekezo Aug 22, 2023
1a740bd
src/json/mouse_keys_full.json.erb -> src/json/mouse_keys_full.json.js
tekezo Aug 22, 2023
53bac68
src/json/emacs_key_bindings.json.rb -> src/json/emacs_key_bindings.js…
tekezo Aug 22, 2023
23486fa
src/json/thumbsense.json.rb -> src/json/thumbsense.json.js
tekezo Aug 22, 2023
44430ed
src/json/caps_lock.json.rb -> src/json/caps_lock.json.js
tekezo Aug 22, 2023
79dab70
Change js to primary language
tekezo Aug 22, 2023
262fd9a
src/json/japanese.json.rb -> src/json/japanese.json.js
tekezo Aug 22, 2023
2f0264f
src/json/example_halt.json.rb -> src/json/example_halt.json.js
tekezo Aug 22, 2023
d40dc05
src/json/escape.json.erb -> src/json/escape.json.js
tekezo Aug 22, 2023
195b669
src/json/example_device.json.erb -> src/json/example_device.json.js
tekezo Aug 22, 2023
398b064
src/json/example_input_source.json.erb -> src/json/example_input_sour…
tekezo Aug 22, 2023
5417192
src/json/example_japanese_nicola.json.rb -> src/json/example_japanese…
tekezo Aug 22, 2023
d70a12f
src/json/example_keyboard_type.json.erb -> src/json/example_keyboard_…
tekezo Aug 22, 2023
165d5a4
src/json/example_select_input_source.json.erb -> src/json/example_sel…
tekezo Aug 22, 2023
ad84616
src/json/exchange_command_backspace_and_option_backspace.json.erb -> …
tekezo Aug 22, 2023
ffdd365
src/json/exchange_command_tab_and_control_tab.json.erb -> src/json/ex…
tekezo Aug 22, 2023
5434cf3
src/json/exchange_hyphen_and_underscore.json.erb -> src/json/exchange…
tekezo Aug 22, 2023
18d6fef
src/json/exchange_numbers_and_symbols.json.erb -> src/json/exchange_n…
tekezo Aug 22, 2023
cd5e7ee
src/json/exchange_semicolon_and_colon.json.erb -> src/json/exchange_s…
tekezo Aug 22, 2023
a91830d
src/json/exchange_single_and_double_quote.json.erb -> src/json/exchan…
tekezo Aug 22, 2023
c1c5b67
src/json/exchange_underscore_and_backslash.json.erb -> src/json/excha…
tekezo Aug 22, 2023
d6a0c9b
src/json/shift_arrows.json.erb -> src/json/shift_arrows.json.js
tekezo Aug 22, 2023
ed7b6b9
src/json/shift_r_home_end_keypress.erb -> src/json/shift_r_home_end_k…
tekezo Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Follow the steps below to create a PR and add your settings!
git switch -c my-settings
```

4. Put a JSON generator file (`.rb`, `.erb` or `.js`) into [src/json](https://github.com/pqrs-org/KE-complex_modifications/tree/main/src/json).
4. Put a JSON generator file (`.js`, `.rb` or `.erb`) into [src/json](https://github.com/pqrs-org/KE-complex_modifications/tree/main/src/json).
(Or put a `.json` file directly into [public/json](https://github.com/pqrs-org/KE-complex_modifications/tree/main/public/json) directly.)
5. <details>
<summary>
Expand Down
30 changes: 15 additions & 15 deletions public/json/emacs_key_bindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -104,7 +104,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -175,7 +175,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -323,7 +323,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -395,7 +395,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -467,7 +467,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -539,7 +539,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -610,7 +610,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -844,7 +844,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -918,7 +918,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -992,7 +992,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -1065,7 +1065,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -1266,7 +1266,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -1344,7 +1344,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down Expand Up @@ -1422,7 +1422,7 @@
"^org\\.gnu\\.Emacs$",
"^org\\.gnu\\.AquamacsEmacs$",
"^org\\.gnu\\.Aquamacs$",
"^org\\.pqrs\\.unknownapp.conkeror$",
"^org\\.pqrs\\.unknownapp\\.conkeror$",
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.",
"^net\\.sf\\.cord$",
Expand Down
3 changes: 3 additions & 0 deletions public/json/exchange_numbers_and_symbols.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"title": "Exchange numbers and symbols",
"maintainers": [
"tekezo"
],
"rules": [
{
"description": "Exchange numbers and symbols (1234567890 and !@#$%^&*())",
Expand Down
2 changes: 1 addition & 1 deletion public/json/mouse_keys_full.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
"to": [
{
"mouse_key": {
"speed_multiplier": 2.0
"speed_multiplier": 2
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions public/json/mouse_keys_mode_v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@
"to": [
{
"mouse_key": {
"speed_multiplier": 2.0
"speed_multiplier": 2
}
}
],
Expand Down Expand Up @@ -927,7 +927,7 @@
},
{
"mouse_key": {
"speed_multiplier": 2.0
"speed_multiplier": 2
}
}
],
Expand Down
3 changes: 3 additions & 0 deletions public/json/mouse_keys_simple.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"title": "Mouse keys (simple) (rev 1)",
"maintainers": [
"tekezo"
],
"rules": [
{
"description": "Mouse keys (simple) (rev 1)",
Expand Down
10 changes: 3 additions & 7 deletions src/json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@

This directory contains the JSON generator.

These JSON generators will be called by [update-json.sh](../../scripts/update-json.sh).
These JSON generators will be called by [update-json.sh](../../core/scripts/update-json.sh).
The output files are saved to public/json.

## Supported file extensions

- .js (nodejs is required)
- .js
- .rb
- .erb

## Supported filename format

To generate JSON files successfully, the filename must match `*.json.<file-extension>`.

- *\** : your self-defined name
- *.json* : must add `.json` before filename extension
- *.file-extension* : `.js` or `.rb` or `.erb`
To generate JSON files successfully, the filename must match `*.json.{file-extension}`.
171 changes: 171 additions & 0 deletions src/json/caps_lock.json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// JavaScript should be written in ECMAScript 5.1.

function main() {
console.log(
JSON.stringify(
{
title: 'Change caps_lock key (rev 5)',
rules: [
{
description:
'Change caps_lock key to command+control+option+shift if pressed with other keys',
manipulators: [
{
type: 'basic',
from: {
key_code: 'caps_lock',
modifiers: { optional: ['any'] },
},
to: [
{
key_code: 'left_shift',
modifiers: ['left_command', 'left_control', 'left_option'],
},
],
to_if_alone: [
{
hold_down_milliseconds: 100,
key_code: 'caps_lock',
},
],
},
],
},
{
description:
'Change caps_lock key to command+control+option+shift. (Post escape key when pressed alone)',
manipulators: [
{
type: 'basic',
from: {
key_code: 'caps_lock',
modifiers: { optional: ['any'] },
},
to: [
{
key_code: 'left_shift',
modifiers: ['left_command', 'left_control', 'left_option'],
},
],
to_if_alone: [
{
key_code: 'escape',
},
],
},
],
},
{
description:
'Change caps_lock key to command+control+option+shift. (Post f19 key when pressed alone)',
manipulators: [
{
type: 'basic',
from: {
key_code: 'caps_lock',
modifiers: { optional: ['any'] },
},
to: [
{
key_code: 'left_shift',
modifiers: ['left_command', 'left_control', 'left_option'],
},
],
to_if_alone: [
{
key_code: 'f19',
},
],
},
],
},
{
description:
'Change caps_lock key to command+control+option+shift. (Use shift+caps_lock as caps_lock)',
manipulators: [
{
type: 'basic',
from: {
key_code: 'caps_lock',
modifiers: {
mandatory: ['shift'],
optional: ['caps_lock'],
},
},
to: [
{
key_code: 'caps_lock',
},
],
},
{
type: 'basic',
from: {
key_code: 'caps_lock',
modifiers: { optional: ['any'] },
},
to: [
{
key_code: 'left_shift',
modifiers: ['left_command', 'left_control', 'left_option'],
},
],
},
],
},
{
description:
'Change caps_lock to control if pressed with other keys, to escape if pressed alone.',
manipulators: [
{
type: 'basic',
from: {
key_code: 'caps_lock',
modifiers: { optional: ['any'] },
},
to: [
{
key_code: 'left_control',
},
],
to_if_alone: [
{
key_code: 'escape',
},
],
},
],
},
{
description:
'Change caps_lock to control if pressed with other keys. (rev 2)',
manipulators: [
{
type: 'basic',
from: {
key_code: 'caps_lock',
modifiers: { optional: ['any'] },
},
to: [
{
key_code: 'left_control',
},
],
to_if_alone: [
{
key_code: 'caps_lock',
hold_down_milliseconds: 500,
},
],
},
],
},
],
},
null,
' '
)
)
}

main()
Loading