Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Feedback and Reviews for Audacity 2.x
Forum rules
This board is ONLY for general feedback and discussion about Audacity 2.X.

If you require help, or think you have found a "bug", please post on the forum board relevant to your operating system.
Windows
Mac OS X
GNU/Linux and Unix-like
machineghost
Posts: 67
Joined: Wed Sep 05, 2018 5:00 pm
Operating System: Linux *buntu

Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by machineghost » Sat Feb 08, 2020 3:36 pm

Reproduction Steps:
  1. Click on track #1
  2. Use your keyboard to move to track #2
  3. Paste
Your paste appears on track #1, even though you're really on track #2, because using the keyboard doesn't change the "actual" cursor position (as far as things like pasting go), only it's visual position.

P.S.

Use Case

This seems obvious enough that it doesn't really require a use case ... but just FYI the reason this bug is painful to me is that I do audio for slides (for my lessons).

I've found that roughly one second pause at the start and end of each track makes for a good "transition time" between slides, so I use the "Trim Silence" plugin to remove all silence, then paste exactly one second to the front and back of each track (using the up/down, j/k, and CTRL+V keys ... or at least I would, if I didn't have to instead click on each track).

Of course, I really should just learn the parentheses language that Nyquist uses, and adapt Trim Silence to add that second for me (it almost has it already, but it only preserves existing silence, it doesn't add any) ... but:

A) I'm too busy making lessons about Javascript, and
B) even if I did, I imagine this bug still impacts others :D

waxcylinder
Forum Staff
Posts: 14684
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by waxcylinder » Sat Feb 08, 2020 4:35 pm

machineghost wrote:
Sat Feb 08, 2020 3:36 pm
Reproduction Steps:
  1. Click on track #1
  2. Use your keyboard to move to track #2
  3. Paste
Your paste appears on track #1, even though you're really on track #2, because using the keyboard doesn't change the "actual" cursor position (as far as things like pasting go), only it's visual position.
I tested this on W10 and yes that's what happens - the problem is that using the down arrow at sep 2 shifts "focus" (the tellow border) but not "selection/cursor position" made in track 1

I had a careful read of this page in the Manual
https://manual.audacityteam.org/man/aud ... l#keyboard

Where it says:
To change the focused track, press Up or Down arrow. In this image, we pressed down arrow to change focus to the "Background" track ...
...
Once a track has focus, press Enter or Return to change it from being selected to not selected, or from not selected to selected. Selections are only acted upon if the track containing the selection is itself selected.


But when I tried this I found that the selection remains in track 1, s my paste at step 3 pasted in both tracks - not what you want.

The Manual also says a bit further down:
Once you have a selection, hold Shift while pressing Up or Down arrow to extend or contract the selection up or down tracks.

So I'd have thought that after Step 2 and then pressing Enter the focus and selection i.e. cursor position would transfer to track 2 and leave track 1 - the fact that it does not may be a bug (can any other Audacity QA folk please comment).


I can give you a keyboard based workaround

1) make a selection (for pasting)
2) Click in track 1
3) Press Enter (leaves focus on track 1 but removes selection)
4) Press down arrow (moves focus to track 1 - but nor cursor position selection)
5) Press Enter (this transfers the cursor position to track 2)
6) Ctrl+V - pastes the selection from step 1 only into track 2 and not track 1

WC
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

machineghost
Posts: 67
Joined: Wed Sep 05, 2018 5:00 pm
Operating System: Linux *buntu

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by machineghost » Sat Feb 08, 2020 4:37 pm

waxcylinder wrote:
Sat Feb 08, 2020 4:35 pm
I can give you a keyboard based workaround

1) make a selection (for pasting)
2) Click in track 1
3) Press Enter (leaves focus on track 1 but removes selection)
4) Press down arrow (moves focus to track 1 - but nor cursor position selection)
5) Press Enter (this transfers the cursor position to track 2)
6) Ctrl+V - pastes the selection from step 1 only into track 2 and not track 1

WC
You rock! That will save my wrists from just a bit more wear and tear (and, as a long-time programmer, they need all the help they can get ...)

This still seems like a bug worth fixing, but that workaround will be great in the meantime: thanks a ton!

waxcylinder
Forum Staff
Posts: 14684
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by waxcylinder » Sat Feb 08, 2020 4:54 pm

Glad the workaround worked for you :D 8-)

I've written to my Audacity QA colleagues (we are very few in number) and our key developer to discuss this,

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

billw58
Forum Staff
Posts: 5601
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by billw58 » Sat Feb 08, 2020 5:37 pm

waxcylinder wrote:
Sat Feb 08, 2020 4:35 pm
1) make a selection (for pasting)
2) Click in track 1
3) Press Enter (leaves focus on track 1 but removes selection)
4) Press down arrow (moves focus to track 2 - but not cursor position selection)
5) Press Enter (this transfers the cursor position to track 2)
6) Ctrl+V - pastes the selection from step 1 only into track 2 and not track 1
Doesn't step 2 change the selection?

-- Bill

waxcylinder
Forum Staff
Posts: 14684
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by waxcylinder » Sat Feb 08, 2020 6:01 pm

billw58 wrote:
Sat Feb 08, 2020 5:37 pm
waxcylinder wrote:
Sat Feb 08, 2020 4:35 pm
1) make a selection (for pasting)
2) Click in track 1
3) Press Enter (leaves focus on track 1 but removes selection)
4) Press down arrow (moves focus to track 2 - but not cursor position selection)
5) Press Enter (this transfers the cursor position to track 2)
6) Ctrl+V - pastes the selection from step 1 only into track 2 and not track 1
Doesn't step 2 change the selection?
Step 2 makes the (point) selection in Tack-1 and places focus on track-1

If you omit step 3 and then do step 4 focus is moved to track-2 but it's track-1 that remains selected
(so if you omit Step 5 - step 6 pastes in the selected track NOT the focused track,

This is down to the confusion between focus and selection - and the visual cues can be subtle

As you wrote in our QA discussion thread Bill
Part of the (initial) confusion for me was that shortcuts such as Shift+U work on the focused track, but keyboard shortcuts such as Command+V work on the selected track.
Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

billw58
Forum Staff
Posts: 5601
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by billw58 » Sat Feb 08, 2020 6:22 pm

Peter:
Yes, but my point was that after making the selection (time position or time range) where you want the paste to happen, clicking in track 1 may change that selection. You must start by making the selection in track 1.

-- Bill
Last edited by billw58 on Sat Feb 08, 2020 6:22 pm, edited 1 time in total.
Reason: typo

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by steve » Sat Feb 08, 2020 8:10 pm

machineghost wrote:
Sat Feb 08, 2020 4:37 pm
This still seems like a bug worth fixing,
It's not a bug, but it is quite difficult to explain. Nevertheless, I'll try...

machineghost wrote:
Sat Feb 08, 2020 3:36 pm
  1. Click on track #1
  2. Use your keyboard to move to track #2
  3. Paste
At step 1, track #1 is "selected" and also has "keyboard focus".

You can tell that it is "selected" because the panel on the left end of the track has the colour of a selected track (for the default theme, that's a darker blue/grey colour).

You can tell that it has "focus" because there is a yellow border to the track.
"But what does "focus" mean?" I hear you ask.
The main thing that it means, is that any keyboard command will be grabbed by this track rather than any other track. For example, if you press the "context menu key", then the menu for this specific track will open.


At step 2, look carefully at what happens. The yellow "focus" border moves to track #2, but the first track is still "selected" (the track's panel still has the darker colour).

The "Enter" key toggles the selectedness of the "current track" - that is, that it toggles the selectedness of the track that "has focus". When you press the "Enter" key, the track that has focus grabs the command, and: If the track is "selected", it becomes "non-selected". If the track is "non-selected", it becomes "selected". At this point, (step 2), the first track is "selected", but "keyboard focus" has been moved to the second track. On pressing "Enter", the second track becomes selected in addition to the first track, so now we have two tracks selected. Press "Enter" again, and the second track becomes non-selected, but the first track is unaffected because it doesn't "have focus".

Question: Why do we need to have "focus" and "selectedness"?
Answer: "Focus" is always unique to one thing at a time. For example, when an effect window is open, keyboard focus will be on one control, and that is completely independent of "track selection".


Does that help, or only serve to add confusion?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

billw58
Forum Staff
Posts: 5601
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by billw58 » Sat Feb 08, 2020 10:24 pm

machineghost, here's a macro that may help you out.

Create this macro:
1SecMacro.png
1SecMacro.png (84.11 KiB) Viewed 837 times
Do your thing with Trim Silence to set up the tracks, as you described. Make sure each track starts at time=0.
Click in the first track. Run the macro. It will add silence to the beginning and end of the first track, then move focus and selection to the next track. Run the macro again (you can attach a keyboard shortcut to the macro through Keyboard Preferences). Continue until all the tracks are processed.

Thanks to Steve for pointing out to me how to get this done.

-- Bill

machineghost
Posts: 67
Joined: Wed Sep 05, 2018 5:00 pm
Operating System: Linux *buntu

Re: Pressing Down/Up to Navigate Tracks is Inferior to Clicking on Them

Post by machineghost » Sun Feb 09, 2020 5:07 pm

Wow, you guys rock!

billw58 I can't wait to try that macro, it's exactly what I need. One question though; regarding:
Make sure each track starts at time=0.
Could I add:

"Select All"
"Align Together"
"Start to Zero"
"Select None"

to accomplish that?

And steve everything you said makes perfect sense ... except: why does ENTER add to the selection? It seems like it'd be more natural to have ENTER change the selection to the current track, and make CTRL + ENTER or SHIFT + ENTER (or CTRL + "+", or some other key) do the adding.

Or better yet, why doesn't holding SHIFT and pressing UP or DOWN change my selection? If I knew nothing about Audacity, that'd be the first thing I'd try if I wanted to select multiple tracks using the keyboard.

It just seems to me that, using only the keyboard, I should somehow be able to tell Audacity "I was focused on track #1, and I had it selected; I would now like to focus on and ONLY select track #2" ... without reaching for my mouse.

And it also seems (to me, but you guys have a lot more factors to consider) that the best way to do that would be by using established UI paradigms, and using SHIFT/CTRL to add to selections is very established.

Post Reply