Bug 440058

Summary: Color Sampler on Alt + Left Button not working when switching layers
Product: [Applications] krita Reporter: Andrei Rudenko <rudenkoarts>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73
Priority: NOR    
Version First Reported In: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Andrei Rudenko 2021-07-20 08:04:06 UTC
SUMMARY
Color Sampler on Alt + Left Button not work when switching layers or pressing alt several times
For Ctrl + Left Button it works.

STEPS TO REPRODUCE
1. Goto Configure Krita -> Canvas input settings -> Alternate Invocation
2. Change "Sample Foreground Color from Merged Image" to Alt + Left Button
3. Select different layer, move cursor to canvas and press alt to pick color right away(if you wait for a second and hold it works).
4. Press left mouse, or stylus to pick color.

Or same as 1,2
3. Select Brush tool then press and hold alt several times on canvas (with random timing)
4. Press left mouse, or stylus to pick color.

OBSERVED RESULT
Sometimes it not switching to color sampler.
Even locked to not able to switch to color sampler for next alt press.

EXPECTED RESULT
Switch to color sampler, and sample the color.

In krita 4.4.5 it works well.

SOFTWARE/OS VERSIONS
Windows: 10
Krita 5.0.0 git cd8ec92938 same for stable branch d76fe492bf
Comment 1 Dmitry Kazakov 2021-07-20 08:06:44 UTC
Hi, Andrei!

Are you sure it worked before? Pressing Alt usually activates window menu, so Krita's canvas loses keyboard focus and cannot process keyboard events anymore. That was actually the reason why I gave up using Alt+Shift shortcut for switching languages :)
Comment 2 Andrei Rudenko 2021-07-20 08:17:24 UTC
(In reply to Dmitry Kazakov from comment #1)
> Hi, Andrei!
> 
> Are you sure it worked before? Pressing Alt usually activates window menu,
> so Krita's canvas loses keyboard focus and cannot process keyboard events
> anymore. That was actually the reason why I gave up using Alt+Shift shortcut
> for switching languages :)

Hi Dmitry!

Yes, i was trying to switch to Krita 5, but had this issue when i was drawing. 
But in 4.4.5 all good.

Im thinking about switching back to Ctrl for pick color, but when you zoom by Ctrl + Space sometimes you release Space while holding Ctrl and it switches to picker, and i pick some color but i dont want to :)
Comment 3 Dmitry Kazakov 2021-07-20 08:52:04 UTC
Git commit b8a0976b82340c05d7b518eb48e00779e9eab709 by Dmitry Kazakov.
Committed on 20/07/2021 at 08:51.
Pushed by dkazakov into branch 'master'.

Fix shortcuts involving Alt key on Windows

Windows key VK_MENU is actually an Alt key :)

M  +1    -1    libs/ui/input/kis_extended_modifiers_mapper.cpp

https://invent.kde.org/graphics/krita/commit/b8a0976b82340c05d7b518eb48e00779e9eab709