Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When unfocusing a node while the Spacebar is still pressed, the check state should be toggled #312

Closed
vincentparrett opened this issue Jan 21, 2015 · 11 comments
Labels

Comments

@vincentparrett
Copy link
Contributor

From [email protected] on January 09, 2013 00:19:01

What steps will reproduce the problem? 1. Make a VTV with checkboxes. Pages 4 and 8 of Advanced demo will work perfectly.
2. Move focus to VTV.
3. Press and hold SPACE.
4. Tap DOWN.
5. Release SPACE.

(Steps 2 to 4 simulate quick typing, when the user presses down before releasing space.)

Expected: The box should check.
Actual: The box stays unchecked.
Version: SVN as of Jan 8 2013
OS: Win7 x64

Possible workarounds.
EASIEST: check when press spacebar.
EASY: when press spacebar, check the box, then switch it to “pressed” state. When release spacebar, do not check, of course.
HARDEST: when changing focus with keyboard and there’s spacebar held, check.

Original issue: http://code.google.com/p/virtual-treeview/issues/detail?id=312

@vincentparrett
Copy link
Contributor Author

From [email protected] on January 08, 2013 05:20:13

(Steps 3 to 5 simulate quick typing, when the user presses down before releasing space.)

@vincentparrett
Copy link
Contributor Author

From [email protected] on January 08, 2013 05:21:54

Well, maybe you type really quickly. Or really slowly. So here’s the sure way to reproduce.

@vincentparrett
Copy link
Contributor Author

From [email protected] on January 18, 2013 12:39:11

OK, I tried with Delphi 7, but no luck. in reproducing the issue.
What exactly do you mean by "Tap DOWN"?

Owner: [email protected]
Labels: -Priority-Medium Priority-Low

@vincentparrett
Copy link
Contributor Author

From [email protected] on January 18, 2013 17:50:59

Press and release ↓ (down arrow) on keyboard, while holding space bar.

In reality, when you type quickly, the events follow in such an order: press space, press ↓, release space, release ↓. But your bug appears after the 2nd event, that’s why tapping down arrow while holding space is enough.

@vincentparrett
Copy link
Contributor Author

From [email protected] on January 27, 2013 12:20:11

I think I finally understood what you mean. But I am not really sure if this is truly a bug. I compared the behavior to a Delphi TCheckbox and it is very similar: The check is set when I release the spacebar.

Summary: Switching a checkbox through Spacebar should be done in KeyDown event, not KeyUp event (was: PRESS of spacebar should switch the checkbox, not RELEASE (revisited))

@vincentparrett
Copy link
Contributor Author

From [email protected] on January 27, 2013 12:30:53

Tested. Do put multiple checkboxes, not just one. Guys at Microsoft implemented the HARDEST way: when you press ↓ while holding space, the box checks. Isn’t particularly pleasant for quick-typer, but does its job.

@vincentparrett
Copy link
Contributor Author

From [email protected] on February 10, 2013 12:35:44

Confirmed. Leaving a TCheckbox with the TAB key while space bar is down cause the checkbox to toggle.

@vincentparrett
Copy link
Contributor Author

From [email protected] on February 11, 2013 13:37:30

↓ arrow also works in multiple TCheckBox’es. As I said, Microsoft implemented the HARDEST way, though Win7 animations confuse quick-typer a bit.

@vincentparrett
Copy link
Contributor Author

From [email protected] on December 11, 2013 04:35:53

Would you mind if I turn my “quick-hack” code into a complete patch? Currently I’ve implemented this thing in EASY way and more or less tested, but the code is terrible — like any code for internal use.

@vincentparrett
Copy link
Contributor Author

From [email protected] on December 12, 2013 03:59:55

Of course you can send a patch. It depends on its quality if I will include it. I don't see this issue as critical and wouldn't like to risk other bugs due to bad code quality of the patch.

By the way, in may applications I am automatically advancing to the next node in case the use presses the space bar to check an item. Although this is not a standard behavior this is very convenient when using it.

@vincentparrett
Copy link
Contributor Author

From [email protected] on December 12, 2013 17:51:21

Well, I need a few hours to isolate this issue from other patches and check all poor places. Among my other remakes:

  • When multi-selection is on, Ctrl+arrows move void cursor instead of scrolling with cursor in place (imcomplete — for ↑↓ only).
  • Added an “alternate selection” mode: when the programmer wants multi-selection and does not wand D&D, selection works like Alt is pressed. Right now via a special option, but, maybe, it’s better to do this automatically.

@joachimmarder joachimmarder changed the title Switching a checkbox through Spacebar should be done in KeyDown event, not KeyUp event When unfocusing a node while the Spacebar is still pressed, the check state should be toggled Mar 5, 2017
joachimmarder pushed a commit that referenced this issue Mar 5, 2017
…pressed, the check state should be toggled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants