Skip to content
Commit d64d85fb authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix shortcuts when the cursor is outside the canvas

This patch needs testing on Windows, OSX and all the variations
of DE on Linux!

Before today the focus was automatically transferred to the canvas
when the cursor was hovering over it. That caused all input boxes
in the dockers work only when you keep the cursor over them. That
was hardly convenient.

Now the focus can be transferred in a semi-automatic way.

* if you move the cursor outside the canvas without clicking anywhere
  the focus is kept on the canvas and you can still use the shortcuts

* if you click in any input box outside the canvas, the focus will be
  transferred to that input box. Therefore the shortcuts will not work.

* to return input focus to the canvas you should do one of the following:
    - just start a stroke on it
    - keep your cursor *moving* over the canvas for 2 seconds and
      the focus will be transferred automatically. "Moving" condition is
      needed for a case when you drop your mouse or a stylus in a fixed
      position on a canvas and move your hands to the keyboard to fill
      in input boxes in the dockers. If you do this "dropping" quick
      enough (< 2 sec), the focus will be kept on your input box :)

To implement such behavior I had to create a special class
KisTimedSignalThreshold which uses almost the same interface as
KisSignalsCompressor, but does what we need: emit the signal if the
flow of events is strong enough.

Fixes T2346
BUG:362217,343763
CC:kimageshop@kde.org
parent 0f72f00c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment