HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

LayerWindow: forward keypresses to canvas #478

Closed dsizzle closed 1 year ago

dsizzle commented 1 year ago

if key is pressed in layer window, activate image window and post the message to it.

Maybe fixes part of #403 ? Only from the Layer window so far.

humdingerb commented 1 year ago

That does work for ALT keycombos, but it doesn't for single-letter-combos for changing the tool, e.g. 'b' for the brush tool. Could those non-modifier key presses be sent to the tool manager instead?

If we ever want menu shortcuts for the Layers window, can those be intercepted before activating and sending the message to the main window?

dsizzle commented 1 year ago

Could those non-modifier key presses be sent to the tool manager instead?

not sure about directly. They might need to go thru the image window and get passed along. I think the alt key is really what’s triggering this at the moment so it needs more investigation for a full solution.

If we ever want menu shortcuts for the Layers window, can those be intercepted before activating and sending the message to the main window?

not sure here either, but if we can send keypresses to the main window successfully , do we need a menu in the layer window anymore?

humdingerb commented 1 year ago

not sure here either, but if we can send keypresses to the main window successfully , do we need a menu in the layer window anymore?

I don't see the direct connection between sending keypresses to main window and having a menu in the Layers window. We already have the same menu in the Layers window and main window. I think the reason is that if you're already mousing around on the Layers menu (making un/visible, reordering, renaming, setting modes and alpha), it'd be annoying having to move the mouse to the main window's Layer menu and back.

This could of course be avoided by adding icon buttons to the Layers window. Saves even a click by not having to open the menu... I do mention those a lot, don't I. :)

Let's merge this then. It's nice having commands forwarded!

dsizzle commented 1 year ago

ok, I was digging into why the tool items don't get selected, and I remembered why - the letter keys are stopped on purpose, because they fire even when you are typing in the layer name boxes. I need to see if I can detect if the user is typing a layer name before allowing those keys to update the tool. Otherwise it's crazy when the tools change as you are typing.

humdingerb commented 1 year ago

Maybe just do it on April fool's... :D