Input symbols
Input symbols (which can be used as key alias) by layer + keys. When press and
hold key z
to activate the 'symbols' layer:
←
,→
,↑
,↓
,␣
,⏎
,⌫
,⌦
: Paste the symbol.,
: Paste‹
(for "left side" which looks nicer than<
)..
: Paste›
(for "right side" which looks nicer than>
).4
: Paste⇥
5
: Paste⎋
6
: Paste⌘
7
: Paste⌥
8
: Paste⌃
9
: Paste⇧
0
: Paste⇪
Use any key for the layer, also consider using:
simlayer('z', 'symbols')
hyperLayer('z', 'symbols')
duoLayer('z', 'x', 'symbols')
Copy and edit the code below in the online editor:
export const rules = () => [
layer('z', 'symbols').manipulators([
withMapper(['←', '→', '↑', '↓', '␣', '⏎', '⌫', '⌦'])((k) =>
map(k).toPaste(k),
),
{ ',': toPaste('‹'), '.': toPaste('›') },
withMapper({ 4: '⇥', 5: '⎋', 6: '⌘', 7: '⌥', 8: '⌃', 9: '⇧', 0: '⇪' })(
(k, v) => map(k).toPaste(v),
),
]),
]
Or copy the JSON below and add it to Karabiner-Elements without changes:
{
"description": "Layer - symbols",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "z"
},
"to": [
{
"set_variable": {
"name": "symbols",
"value": 1
}
}
],
"conditions": [
{
"type": "variable_unless",
"name": "symbols",
"value": 1
}
],
"to_if_alone": [
{
"key_code": "z"
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "symbols",
"value": 0
}
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_arrow"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"←\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_arrow"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"→\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "up_arrow"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"↑\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "down_arrow"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"↓\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "spacebar"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"␣\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "return_or_enter"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⏎\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "delete_or_backspace"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⌫\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "delete_forward"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⌦\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "comma"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"‹\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "period"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"›\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "0"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⇪\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "4"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⇥\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "5"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⎋\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "6"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⌘\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "7"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⌥\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "8"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⌃\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "9"
},
"to": [
{
"shell_command": "osascript -e '\nset prev to the clipboard\nset the clipboard to \"⇧\"\ntell application \"System Events\"\n keystroke \"v\" using command down\n delay 0.1\nend tell\nset the clipboard to prev'"
}
],
"conditions": [
{
"type": "variable_if",
"name": "symbols",
"value": 1
}
]
}
]
}