Tom94 / tev

High dynamic range (HDR) image viewer for graphics people
BSD 3-Clause "New" or "Revised" License
1.02k stars 86 forks source link

Use key Tab to show pixel raw bytes #193

Open chaosink opened 1 year ago

chaosink commented 1 year ago

Shift+Ctrl should be held to show pixel raw bytes. But this keybinding conflicts with others, like reference image selection. A usage case prevented by this is that: keep showing pixel raw bytes, and switch between images by number keys for comparison.

This commit changes the keybinding to Tab. @Tom94 Maybe you want another key. Thanks!

Tom94 commented 1 year ago

This is a good idea. I've been bothered by the overlap in hold-keybindings for a while... although what kept me away from Tab so far is how easy it'd make it to press Ctrl+Tab or Alt+Tab accidentally.

However, now that I think about this a bit more deeply: the spacebar is currently unused in tev, and I can't think of typical OS-wide shortcuts that it might cause conflicts with (other than Cmd+Space on macOS, but I don't think tev uses Cmd for any hold action). What's your opinion on using space instead of tab?

(That aside, for the PR, could you also change the listed keybinding in HelpWindow.cpp?)

chaosink commented 1 year ago

Forgot to change the keybinding in HelpWindow.cpp. Thanks for pointing it out. Will do it later.

Agree on the disadvantage of Tab.

Space is used for image play. Just notice that the 3 keybindings (Space, Home, End) for image play are not listed in HelpWindow.cpp.

What about key B (raw 'B'ytes)?

We may also distinguish between left and right Shift/Ctrl/Alt and use the right ones (they are the most useless keys) to show pixel raw bytes. Though we may need to move the right hand from the mouse to the keyboard (of course we can still use the left hand), I think it's OK due to the enough keybindings.

What do you think?

Tom94 commented 1 year ago

Oh wow, I totally forgot about playback -- thanks for pointing it out. You're right, I need to add those to the help window. And while at that make it scrollable... IIRC it's already pushing the default size of the window.

I do like 'B'. While it conflicts with Ctrl+B (which hides/shows the sidebar), that shortcut is only triggered when Ctrl is already held at the point when B is pressed. Which I suppose happens rarely enough. Please feel free to make the change.