Skip to content

Commit

Permalink
altGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed Nov 28, 2024
1 parent bafdd6a commit fa4988e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resen/kaddish/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function update_caret(current) {
const first = update_caret()

document.addEventListener('keydown', event => {
if (event.altKey || event.ctrlKey || event.metaKey)
if (event.altKey || event.getModifierState('AltGraph') || event.ctrlKey || event.metaKey)
return
const chars = [...document.querySelectorAll('svg text:not(:empty)')]
const current = chars.pop()
Expand Down
2 changes: 1 addition & 1 deletion resen/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ function is_shortcut(event, shortcut) {
|| event.code == 'Digit' + shortcut_key // For AZERTY keyboard
|| !event_key.match(/^[a-z]$/) && event.code == 'Key' + shortcut_key.toUpperCase()) // For Hebrew keyboard
event_key = shortcut_key
return event_key == shortcut_key && event.altKey == shortcut.includes('alt') && (event.ctrlKey || event.metaKey) == shortcut.includes('ctrl') && event.shiftKey == shortcut.includes('shift')
return event_key == shortcut_key && (event.altKey || event.getModifierState('AltGraph')) == shortcut.includes('alt') && (event.ctrlKey || event.metaKey) == shortcut.includes('ctrl') && event.shiftKey == shortcut.includes('shift')
}


Expand Down
2 changes: 1 addition & 1 deletion resen/snark/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function click(event) {
const containers = document.querySelectorAll('div[oncontextmenu*=toggle_fullscreen]')

document.addEventListener('keydown', event => {
if (event.altKey || event.ctrlKey || event.metaKey || !event.key.match(/^[א-תa-zA-Z]$/) && event.key != 'Backspace' && event.key != 'CapsLock')
if (event.altKey || event.getModifierState('AltGraph') || event.ctrlKey || event.metaKey || !event.key.match(/^[א-תa-zA-Z]$/) && event.key != 'Backspace' && event.key != 'CapsLock')
return
const current = containers[1].classList.contains('fullscreen') | 0
const svgs = document.querySelectorAll('svg')
Expand Down

0 comments on commit fa4988e

Please sign in to comment.