Xournalpp: Ctrl+shift+(Left/right arrow) does not select text, it changes layers

Created on 10 Mar 2019  ·  5Comments  ·  Source: xournalpp/xournalpp

I need to select a word of text (for example pressing Ctrl+shift+right arrow with the cursor at word1 selects "word1"), so I press Ctrl+Shift+left arrow or Ctrl+Shift+right arrow and that sometimes changes the layer instead. Is there a way to possibly change this default shortcut or possibly include it in the scripting feature (#919)?
I get this issue when I draw or click on the bottom > "New Layer". If I just use the background layer, this works perfectly.
I don't have much time to fully focus on contributing code because I'm in school, but I'll see what I can do if I get some free time. There is no error because the switching layers is probably configured with these keyboard shortcuts by default.

It might have something to do with ACTION_GOTO_PREVIOUS_LAYER and ACTION_GOTO_NEXT_LAYER:
https://github.com/xournalpp/xournalpp/blob/a071b52ca614e815857fe12f06d8195ecffe8f79/src/enums/ActionType.enum.h

bug

All 5 comments

We can do this when we work on #841

It's much more common to edit text than to switch layers, so I think it would be better to have CtrlShift and CtrlShift select text when editing a text object The current behavior can remain for everything else.

This can be handled with #919

This is actually a bit tricky, since the layer menu item is receiving (and handling) the CtrlShift and CtrlShift keypresses (in the activate callback) before the event can be handled by the TextEditor.

I encountered a comparable issue while experimenting with plugins.
A plugin that registers a plain key (let's say "e") captures this key even if the user is editing text, which technically makes it impossible to type the letter "e".

I found a workaround on https://stackoverflow.com/a/61584287/2297277 which I tested (I'm not sure where the best place would be for this code so I did not create a pull request):

g_signal_connect(window,"key-press-event",G_CALLBACK(gtk_window_propagate_key_event),NULL);
g_signal_connect(window,"key-release-event",G_CALLBACK(gtk_window_propagate_key_event),NULL);

With this, both the "e" and the Ctrl+Shift+arrows are working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

terencode picture terencode  ·  5Comments

frohro picture frohro  ·  3Comments

dimkab picture dimkab  ·  4Comments

luyatshimbalanga picture luyatshimbalanga  ·  5Comments

coldspark29 picture coldspark29  ·  3Comments