This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Fail to emulate user's input when focused element changed in middle of replaying keystroke. #130
Labels
Comments
t9md
added a commit
to t9md/atom-keymap
that referenced
this issue
Apr 27, 2016
To correctly simulate user input in replaying keystroke, key event should be sent to activeElement instead of original event.target
nathansobo
pushed a commit
that referenced
this issue
Oct 6, 2016
#130 target document.activeElement when replayed
@nathansobo Should this issue keep opened since the PR was reverted? |
@t9md I'm bordering on just saying "won't fix" for this because keystroke sequences are tied to selectors that are intended to match against individual elements. Can you articulate the exact problem you're trying to solve? |
I put on Background section above, but will try to explain again.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is feature enhancement request to solve following problem, limitation.
Problem scenario
Following keymap is not actual scenario I'm facing. But for clarity.
When I have following keymap, keystroke
cmd-t a
don't puta
character to fuzzy-finder's mini-editor.Without this keymap(default),
cmd-t a
keystroke puta
char to fuzz-finder's mini-editor.I want put
a
on mini-editor even if I set following keymap.Reason
When atom-keymap replaying keystroke, it replaying against original
event.target
, not aware of focused element change.Proposal to fix
idea-1
Change this line.
From
To
idea-2
Provides public API to manually inform focus change to atom.keymap.
Background
I'm developing vim-mode-plus(this issue is also affect official vim-mode).
t9md/atom-vim-mode-plus#260
t9md/atom-vim-mode-plus#254
For example, vim-mode has
m
command to mark current cursor position.m
take single a to z char from user via mini-editor.So user can save cursor position to a mark by
ma
, to b mark bymb
.Since I don't need such big number of mark, I want to map
mm
to different command.But after I set
"m m": "different-command"
keymap, originalm
breaks.E.g. The keystroke
md
to save position to d mark will throw error(in vim-mode, vim-mode-plus case).Why? replayed
d
is handled by oringalevent.target
(=editorElement) andd
matchesvim-mode-plus:delete
command.But this is unexpected scenario where another operation command is pushed to vim-mode-plus's operationStack while previous command
m
(mark) command have not yet finished(in this timing vim-mode is just waiting mark char through mini-editor).The text was updated successfully, but these errors were encountered: