Closed pq closed 5 years ago
@artfwo: when you have a moment, could you tell me what you see for "which" and "keyCode" when you type p
in here?
https://css-tricks.com/snippets/javascript/javascript-keycodes/#article-header-id-0
which: 80
keyCode: 80
shiftKey: false
altKey: false
ctrlKey: false
metaKey: false
i saw this yesterday on chrome (on a chromebook) so the os (and keyboard) may not be related. more to investigate...
I have the same issue on chrome / win10
ah, thanks @x2mirko!
hey @anthonybarsotti: it occurs to me maybe you have some ideas here? is it just a "browser thing" that some key events are not interceptable?
for context, key handling is happening here:
with listening happening here:
i wonder if trying the editor.blur()
and setTimeout()
trick described in https://github.com/ajaxorg/ace/issues/3179 isn't worth a shot...
Same issue in Chromium / i3 on Arch
It looks like the problem is that the keybinding provided in services.js
applies to the window but does not define handling in the editor. I've had success in the default ACE editor by adding a scriptRun
prop to the Editor
class and adding the following prop to its JSX render-instantiation of the AceEditor
class in editor.js
:
commands={[{
name: 'play',
bindKey: { win: 'Ctrl-P', mac: 'Ctrl-P' },
exec: () => {
scriptRun && scriptRun(getActiveBuffer());
}
}]}
Note that this does not appear to apply to the Vim keybindings (whose defaults oddly map this to k
for moving up a line). I cannot speak for Emacs as I am completely incompetent in Emacs.
Good to know - this is an area that hasn’t been touched in awhile. A PR which gets thing working would be most welcome
reported by @artfwo,
ctrl+p
does not work in:i've also seen it not taking in: