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

a_press_middle_click_left registering as a_click_middle then q_press_middle_click_left #10

Open
khonkhortisan opened this issue Feb 18, 2021 · 3 comments
Labels
wontfix This will not be worked on

Comments

@khonkhortisan
Copy link

I've been using a mouse with the default review hotmouse settings. I just started using maobi - Chinese Hanzi Writing Quizzes with an old wacom tablet (Wacom Graphire 2 Tablet ET-0405A-U0S with Mouse & Pen USB Ruby, missing the pen holder, not the graphire 1 with its knob and round bottom).
imagen
Tapping on the tablet with either end of the pen is a left click, clicking the front button is a middle click, clicking the back button is a right click. I added this to the config

    "q_click_middle": "show_ans",
    "a_click_middle": "good",
    "a_press_middle_click_left": "again",

so that middle clicking acts the same as scrolling down, it flips the card or rates good. And then holding middle click and tapping the pen left click I expected to rate again, but a_press_middle_click_left for again instead does a_click_middle for good.
Also, a_press_middle_scroll_down for easy and a_press_middle_scroll_up both rate good as well now.
Expected behavior:

    "q_click_middle": "show_ans",
    "a_click_middle": "good",
    "a_press_middle_click_left": "again",
    "a_press_middle_wheel_down": "easy",
    "a_press_middle_wheel_up": "hard",

Actual behavior (not config):

    "q_click_middle": "show_ans",
    "a_click_middle": "good",
    "a_press_middle_click_left": "good",
    "a_press_middle_wheel_down": "good",
    "a_press_middle_wheel_up": "good",

If I check the debug

    "tooltip": true,
    "z_debug": true

[wow, it was being slow, so I installed wacomtablet_6.2.0w5.exe and now I have it working in screen space with tap animations! And I can hover scroll and hover drag windows and hover resize windows and my mouse cursor is huge and the back button is now left click and the forward button is now left click so I just ruined this middle click thing I was attempting… and speed and acceleration and mapping buttons]
imagen

on the answer side, pressing the middle button down shows a tooltip of [good] and goes to the next card, then pressing the left button down shows a tooltip of [q_press_middle_click_left] when I wanted a_press_middle_click_left.

Here's the whole config:

{
    "a_click_middle": "good",
    "a_click_right": "undo",
    "a_press_left_click_right": "off",
    "a_press_middle_click_left": "again",
    "a_press_middle_wheel_down": "easy",
    "a_press_middle_wheel_up": "hard",
    "a_wheel_down": "good",
    "a_wheel_up": "again",
    "q_click_middle": "show_ans",
    "q_click_right": "undo",
    "q_press_left_click_right": "off",
    "q_wheel_down": "show_ans",
    "threshold_wheel_ms": 350,
    "tooltip": true,
    "z_debug": true
}

All the other settings not mentioned in Actual behavior work correctly.

@BlueGreenMagick
Copy link
Owner

BlueGreenMagick commented Feb 19, 2021

click_middle triggers the moment you press(click) the button (contrary to releasing the button), so a_click_middle is triggering before a_press_middle_click_left.

It should work if you rename a_click_middle to a_press_middle. Hotkeys ending with press_middle triggers when you release the button.

Do correct me if I misunderstood you!

@khonkhortisan
Copy link
Author

khonkhortisan commented Feb 19, 2021

That doesn't sound right. I'd expect something that activates when the button is released to be called a_release_middle, and something called a_press_middle to activate when the button is pressed.

I understand a click as being the combination of a press and a release (with no repeat presses nor repeat releases). So it could either be defined as happening at press assuming the user will release the button soon, or defined as happening at release where a click definitely happened. And programs don't agree on which it is:
Click is on press: Anki File/Edit/Tools/Help toolbar and selecting cards/fields, firefox/chrome switching tabs, Review Hotmouse, blender toolbar and pop-up menus and tabs, task manager toolbar and tabs, first windows titlebar button
Click is on release: Anki Decks/Add/Browse/Stats/Sync toolbar and list of decks, firefox/chrome opening link or context menu, Windows start menu, blender treeview and number input boxes, task manager selecting app and kill button, last windows titlebar buttons

In autohotkey, if I send {space down} it sends a key press event, if I send {space up} it sends a key release event, if I send {space} it sends a key press then waits for a configurable delay then sends a key release.
If I wanted to clone the functionality of a_press_middle_click_left in autohotkey, I'd first wait for an event from the left button, then check whether the middle button's state is that it's currently pressed. But that means keeping track of the middle button's state by catching its event first.

If a click event happens at release, then a_press_middle_click_left will happen before a_click_middle.
If a click event happens at press, then a_click_middle will happen before a_press_middle_click_left?

After switching a_click_middle to a_press_middle and restarting:
pressing the middle button logs a_click_middle and changes the mouse cursor to indicate it's in scrolling mode
clicking the middle button twice logs a_click_middle on each press, puts it into scrolling mode and takes it back out, and then rates the card good after the second release of the button.
pressing the middle button then pressing the left button rates the card again, then releasing both buttons doesn't log anything regardless of order.

What you suggested makes it work, other than middle click scroll interfering requiring another middle click, but I still disagree with something called press activating on release.

@BlueGreenMagick
Copy link
Owner

BlueGreenMagick commented Feb 20, 2021

I do agree with your thoughts. The current terminology is quite confusing and sometimes the opposite of what would be intuitive. Even I didn't realize what the problem here was without turning on debug. It would have caused much less confusion if I used release in the place of press.

But I am unable to do much about it - changing them will lead to everyone's existing configuration to break. Renaming an existing key is a huge job that I'm reluctant to do so. I'm open to ideas if you are aware of an easy way to do so, but I'm afraid the best I can do for now is to clarify this in the description.

@BlueGreenMagick BlueGreenMagick added the wontfix This will not be worked on label Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants