FrancescoCeruti / linux-show-player

Linux Show Player - Cue player designed for stage productions
https://linux-show-player.org
GNU General Public License v3.0
205 stars 49 forks source link

Add shortcut for cue (issue #158) #172

Closed Gajenthran closed 3 years ago

Gajenthran commented 5 years ago

As I said on the title, I add shortcut for cues (issues #158 and #160) with QKeySequenceEdit. I have not changed a lot of things : I replace the QLineEdit with QKeySequenceEdit for the first column, to have a variety of commands. Then I modified a little bit the key_pressed function in keyboard.py to include QKeySequence.

Hope it will help you !

FrancescoCeruti commented 5 years ago

Thanks :smile:

I've tested the solution but unfortunately the QKeySequenceEdit is a bit inadequate :slightly_frowning_face:

I've already implemented a solution using a custom widget that provide an alternative way to insert the mentioned keys, I'll push it when at home.

Gajenthran commented 5 years ago

I saw it (I had a little problem with the List Layout but I saw the issue about that).

Some keys (or combinations) cannot be entered because are intercepted elsewhere (e.g. Esc , Tab , Enter) to navigate the widgets (e.g. Esc close the editor)

I forgot that point. Don't you think we should also do for Selection Mode ? For example if I had a new shortcut with UP arrow, it will allow my shortcut and the action for the selection Mode and will potentially create conflict.

I put some lines to avoid that kind of conflict in layout.py, you can check it if you want.

Gajenthran commented 5 years ago

Instead of creating a new pull request, I put it in this. I add more features to shorten (editing and removing) in the list. I felt that it was not necessary to create new pull request because it's minor changement in the code.

Hope it will help you !