Author Topic: Edit a Command "Ctrl" Shortcuts - Unexpected Behavior  (Read 3348 times)

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Edit a Command "Ctrl" Shortcuts - Unexpected Behavior
« on: November 21, 2016, 11:53:15 AM »
I've noticed that I experience varying behavior in the "Edit a Command" window when I use the various Copy, Paste, Undo, Redo, etc Shortcuts (Ctrl+C, Ctrl+V, etc). Please bear in mind that I've done testing for these issues using a fresh install of VA, I don't have any commands that make use of the Ctrl key to call commands or send key presses, and I have absolutely no issues with the copy and paste shortcut keys in applications like Notepad or Word:
  • I've found that the Copy and Paste shortcuts only seem to consistently work for me when I sort of "hold down and pause on" the Ctrl key and then use "C" or "V" for copying and pasting. Usually when I'm in other applications I only have to hold down the Ctrl key for as long as it takes my other finger to reach "C" or "V." Even as I type now the Ctrl+Key shortcut is nice and timely. But in VA it feels like I need to dwell longer on the Ctrl key before anything happens when I press "C" or "V." If I had issues in other applications I'd probably conclude that my Left Ctrl key is starting to wear out, but this is not the case. Even stranger, I feel like the Right Ctrl is more responsive to making the copy and paste shortcuts happen (though again, I have zero issues when using the Left Ctrl in other applications). I'll also note that the Undo and Redo shortcuts (Ctrl+Z and Ctrl+Y) as well as the shortcut to move lines of code up and down (Ctrl+UpArrow and Ctrl+DownArrow) work absolutely fine regardless of which Ctrl key is utilized. Does anyone else experience this behavior?
  • Depending on the content in the command sequence the Ctrl+C, Ctrl+V, and other shortcut keys (when they work, see #1) may "jump" to lines of code instead of performing their normal Copy and Paste functions. Let me give an example. In the following code the copy and paste shortcuts behave as expected (these are comment lines in the action sequence):
Code: [Select]
A
B
U
W
However, if I insert a line of code that begins with the letter "C" or "V," the behavior of the Ctrl+C and Ctrl+V shortcuts changes. So for this example...
Code: [Select]
A
B
C
U
V
W
...if I select the line containing "W" and press Ctrl+C the selection snaps up to the line containing "C." This same behavior happens with "V" in that selecting a line like "A" and then pressing Ctrl+V will snap the selection down to the line containing "V." The behavior is similar for the Cut (Ctrl+X), Undo (Ctrl+Z), and Redo (Ctrl+Y) when the code has lines that start with "X," "Z," or "Y."

I've also seen the behaviors in #1 and #2 occur in unison. Please refer back to the second code example above. If I press Ctrl+C the selection will snap to the "C" line. Assuming my input actually gets VA to "copy," if I then press Ctrl, hold it down for about 0.5 seconds then press "V" the selection will snap down to the line with "V" and a new line will get pasted in!

So I guess in summary from my use of VA it looks like there is a difference between a "quick" Ctrl+Keypress (like how you would "normally" use this shortcut for things like copying and pasting) and a "long" Ctrl+Keypress (where I hold down Ctrl a bit longer before I press the subsequent key). I've attached a short video that demonstrates the above behaviors. It shows how the selection snaps from line "A" to "C" when I "short press" Ctrl+C, and it shows how the selection snaps down to line "V" and pastes when I perform a "long press" Ctrl+V. I've got a video demonstrating this behavior, but I keep getting a server error every time I try to attach it (.avi or .wmv).

Any thoughts or suggestions from the community would be most appreciated!
« Last Edit: November 21, 2016, 11:57:01 AM by Exergist »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Edit a Command "Ctrl" Shortcuts - Unexpected Behavior
« Reply #1 on: November 21, 2016, 01:46:02 PM »
shortcut keys (when they work, see #1) may "jump" to lines of code instead of performing their normal Copy and Paste functions.
That's not a property of the shortcut, rather of the listbox. It will attempt to select the item starting with the character you type.

Usually it's not a huge issue, because there are very few actions starting with "C"(There are four, to be precise), and none starting with "V".


It's possible to override this behavior, and I believe this may be a solution, where it is suppressed only when a key combination is a shortcut. This would be for Gary to have a look at.

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Edit a Command "Ctrl" Shortcuts - Unexpected Behavior
« Reply #2 on: November 21, 2016, 02:06:12 PM »
Awesome, thanks for the response Pfeil!

I understand that the likelihood of running into this is small from an actions point of view. I originally found this because I tend to write descriptive comments for each action line, and I eventually wrote a comment that began with "C."