Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved keyboard shortcuts #135

Open
jonorthwash opened this issue Oct 24, 2017 · 10 comments
Open

improved keyboard shortcuts #135

jonorthwash opened this issue Oct 24, 2017 · 10 comments

Comments

@jonorthwash
Copy link
Owner

I see the interface as having three main parts that you might want to switch between quickly:

  • the navigation area ("page number") at the top, and associated buttons across the top row,
  • the direct editing area (text box) in the middle, and
  • the dependency tree at the bottom.

There should be a quick keyboard shortcut for navigating to each of these from any of the others. The keys should:

  • be semantic and systematic: e.g., if they include a letter key, they should represent terms like navigation, text, and graph (or similar),
  • not conflict with common browser shortcuts,
  • not conflict with text someone might be expected to type into any of the areas (including regular text), and finally
  • not conflict with existing (or potentially just planned) keyboard shortcuts.

I think following something like these guidelines we can get something coherent together.

@jonorthwash
Copy link
Owner Author

A quick screenshot for reference:
2017-10-23-23 44 45_001

@ftyers
Copy link
Collaborator

ftyers commented Oct 29, 2017

Here are the main things to have shortcuts for, and i think they should be global (as in work whatever is focused):

  • Move left/right one tree
  • Show/hide text entry
  • Undo/redo

@jonorthwash
Copy link
Owner Author

Move left/right one tree

You mean, move forward/back one tree?

@jonorthwash
Copy link
Owner Author

Here are the main things to have shortcuts for

You don't think we should have shortcuts for edit functionality?

@jonorthwash
Copy link
Owner Author

jonorthwash commented Oct 29, 2017

(13:34:18) spectie: firespeaker, well, how would it work ?

Keyboard navigation and keyboard-only edit functionality of the graph is crucial, and an original design goal of this tool.

A potential implementation might look like this:

  • Select a node by using left/right arrows in the graph interface.
  • Type d to add a dependency arc to (or from?) the selected node, then arrow keys to change the source (or destination), then enter (or similar) to select.
  • Type e to edit a deprel attached to the current node.
  • Type m to move a dependency arc to a different node.
  • Type +, rightor +, left to insert a token to the left or right of the currently selected token.
    • ins+arrows (+/- for zoom)
  • Some way to edit the text of tokens, dependency relationships, POS tags, etc.
  • Type Shift+PgUp/PgDn anywhere to change sentences. (implemented in d71fcc)
  • Type r to indicate root node (No way to specify root node #92)
  • Type Ctrl+z for undo and Ctrl+y or Ctrl+Shift+z for redo
  • Probably a ton of other stuff I'm not thinking about.

Also, as nodes in the graph are selected, the input area should also highlight the given lemma, relation arc, relation label, part-of-speech label, etc. We'll have to decide which input area is primary and which is secondary, though—or either have a way to switch between them, or make a way so that both are fully accessible through a single set of commands.

@yaskevich
Copy link
Collaborator

This item must be updated to reflect current state of app development, related issues, and proposed features concerning keyboard support, and functionality of undo/redo.

@jonorthwash
Copy link
Owner Author

The underlying issues are the same, and I don't think many of the proposed solutions haven't been implemented yet. Could you go through and check each of the points suggested and check what's been implemented and what hasn't?

@yaskevich
Copy link
Collaborator

It seems that keybindings don't work properly. I didn't manage to run almost anything of the list above.

@jonorthwash
Copy link
Owner Author

Okay, then I think this issue is a priority.

@yaskevich
Copy link
Collaborator

I analyzed the source code which is responsible for keybindings and made a table of all the hotkeys that are implemented. As it turned out, most of the shortcuts fire only when focus is on a specific element.

As to issues:

  • some keybindings are processed inside the app, but bodies of their functions are empty (not implemented)
  • some shortcuts are the same as default ones of a browser, so they are just being intercepted and couldn't fire any action
  • redo function has a bit strange condition (now it's Ctrl + Y || Z, and perhaps more expected shortcut could be like Ctrl +Y, or Ctrl + Shift + Z, as mentioned in the comment above)
  • and it seems that not all keys do what they have to for node text edit control and graph nodes, because node selection doesn't work properly (or maybe I don't understand its mechanics).

There is a list I compiled.

Scope Keys Action
Global Ctrl + Page Down Next sentence
Ctrl + Shift + Page Down Last sentence
Ctrl + Page Up Previous sentence
Ctrl + Shift + Page Down First sentence
Ctrl + Shift + Z Undo
Ctrl + Y Redo
Ctrl + Z Redo
Ctrl + L Focus on label input / intercepted by a browser
Ctrl + (0...9) Zoom graph to the zoom level / intercepted by a browser
Table view Enter Toggle editing of a cell
Tab Go right and toggle editing there
Shift Tab Go left and toggle editing there
Up Go up
Down Go down
Left Arrow Go left
Right Arrow Go right
Esc Restore original cell value when editing a cell
Current sentence number Enter Set corpus index to current sentence
Left Arrow Load previous sentence
J Load previous sentence
Right Arrow Load next sentence
K Load next sentence
- Remove sentence
= Insert sentence
Edit control of a text on a graph Enter Clear graph state
Tab Next element
Shift + Tab Previous element
Esc Clear graph state and exit the edit mode
Textbox of a sentence Esc Unfocus
Enter Not implemented
Tab Insert a tabulation
Chat window Enter Send message
? Not implemented
Graph Del Remove dependency
Backspace Remove dependency
X Remove dependency
D Switch moving mode for dependency
P Set punct (Not implemented)
R Set root
S Split token
M Merge tokens
C Combine tokens
Left Arrow Combine with left token
Right Arrow Combine with right token
= Fit graph to screen
Shift + = Zoom in
- Fit graph to screen
Shift + - Zoom out
Enter Clear graph state
Esc Clear graph state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants