Skip to content
Merged
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion src/static/js/ace2_inner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,15 @@ function Ace2Inner(editorInfo, cssManagers) {

const handleKeyEvent = (evt) => {
if (!isEditable) return;
const {type, charCode, keyCode, which, altKey, shiftKey} = evt;
const {type, charCode, keyCode, which, shiftKey} = evt;

// If DOM3 support exists, ensure that the left ALT key was pressed. This
// allows keyboard layouts with special meaning for right-alt-char to
// continue working on Firefox / macOS.
let altKey = evt.altKey;
if (evt.originalEvent.location !== undefined) {
altKey = altKey && evt.originalEvent.location === evt.originalEvent.DOM_KEY_LOCATION_LEFT;
}

// Don't take action based on modifier keys going up and down.
// Modifier keys do not generate "keypress" events.
Expand Down
Loading