Skip to content

Commit

Permalink
Merge pull request #1475 from pqrs-org/js-migration
Browse files Browse the repository at this point in the history
Js migration
  • Loading branch information
tekezo authored Aug 25, 2023
2 parents 6f6dea8 + 517b756 commit 570ab0a
Show file tree
Hide file tree
Showing 62 changed files with 2,186 additions and 2,543 deletions.
5 changes: 1 addition & 4 deletions public/json/personal_funck.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
},
"to": [
{
"key_code": "right_option",
"modifiers": [

]
"key_code": "right_option"
}
]
}
Expand Down
5 changes: 1 addition & 4 deletions public/json/r400.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
},
"to": [
{
"key_code": "b",
"modifiers": [

]
"key_code": "b"
}
]
}
Expand Down
12 changes: 3 additions & 9 deletions public/json/xcode.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@
"to": [
{
"key_code": "f6",
"modifiers": [

]
"modifiers": []
}
],
"conditions": [
Expand All @@ -157,9 +155,7 @@
"to": [
{
"key_code": "f7",
"modifiers": [

]
"modifiers": []
}
],
"conditions": [
Expand All @@ -184,9 +180,7 @@
"to": [
{
"key_code": "f8",
"modifiers": [

]
"modifiers": []
}
],
"conditions": [
Expand Down
125 changes: 0 additions & 125 deletions src/json/personal_apm1467.json.erb

This file was deleted.

137 changes: 137 additions & 0 deletions src/json/personal_apm1467.json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// JavaScript should be written in ECMAScript 5.1.

function main() {
console.log(
JSON.stringify(
{
title: 'Personal rules (@apm1467)',
rules: [
{
description: 'right_command + j/k → switch between tabs in applications',
manipulators: [
{
type: 'basic',
from: { key_code: 'k', modifiers: { mandatory: ['right_command'], optional: ['caps_lock'] } },
to: [{ key_code: 'close_bracket', modifiers: ['right_command', 'right_shift'] }],
to_after_key_up: [{ key_code: 'vk_none' }],
},
{
type: 'basic',
from: { key_code: 'j', modifiers: { mandatory: ['right_command'], optional: ['caps_lock'] } },
to: [{ key_code: 'open_bracket', modifiers: ['right_command', 'right_shift'] }],
to_after_key_up: [{ key_code: 'vk_none' }],
},
],
},
{
description: 'right_option → shift + command + option',
manipulators: [
{
type: 'basic',
from: { key_code: 'right_option', modifiers: { optional: ['caps_lock'] } },
to: [{ key_code: 'left_shift', modifiers: ['left_option', 'left_command'] }],
},
],
},
{
description: 'shift + command + option + s → redo with sudo',
manipulators: [
{
type: 'basic',
from: { key_code: 's', modifiers: { mandatory: ['shift', 'option', 'command'], optional: ['caps_lock'] } },
to: [
{ key_code: 'up_arrow' },
{ key_code: 'a', modifiers: ['left_control'] },
{ key_code: 's' },
{ key_code: 'u' },
{ key_code: 'd' },
{ key_code: 'o' },
{ key_code: 'spacebar' },
{ key_code: 'return_or_enter' },
],
},
],
},
{
description: 'shift + command + option + spacebar → open screenshot panel',
manipulators: [
{
type: 'basic',
from: { key_code: 'spacebar', modifiers: { mandatory: ['shift', 'option', 'command'], optional: ['caps_lock'] } },
to: [{ key_code: '5', modifiers: ['left_shift', 'left_command'] }],
},
],
},
{
description: 'shift + command + option + equal_sign → 20 equal signs',
manipulators: [
{
type: 'basic',
from: { key_code: 'equal_sign', modifiers: { mandatory: ['shift', 'option', 'command'], optional: ['caps_lock'] } },
to: [
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'equal_sign' },
{ key_code: 'vk_none' },
],
},
],
},
{
description: 'shift + command + option + hyphen → 20 hyphens',
manipulators: [
{
type: 'basic',
from: { key_code: 'hyphen', modifiers: { mandatory: ['shift', 'option', 'command'], optional: ['caps_lock'] } },
to: [
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'hyphen' },
{ key_code: 'vk_none' },
],
},
],
},
],
},
null,
' '
)
)
}

main()
Loading

0 comments on commit 570ab0a

Please sign in to comment.