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

Fix sharing of mouse button state from mousekeys to ps2_mouse #9124

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

manna-harbour
Copy link
Contributor

@manna-harbour manna-harbour commented May 18, 2020

Fix sharing of mouse button state from mousekeys to ps2_mouse.

Description

#1327 shares mousekeys button state with ps2_mouse but prevents clicks when using only mousekeys.

#1344 fixes this but produces clicks from both mousekeys and ps2_mouse.

#1339 (comment) would fix the missing and duplicate cilcks but break mousekeys dragging.

With this change, when ps2_mouse is disabled, mousekeys works as usual. With ps2_mouse enabled, mousekeys button state is shared with ps2_mouse for clicking, dragging, and scrolling, mousekeys clicks are produced by ps2_mouse only, and mousekeys button state is transferred to mousekeys without generating clicks to enable mousekeys dragging.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Resolves #1339.
*

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@manna-harbour manna-harbour changed the title Fix extra mousekeys button click with PS/2 mouse scroll button Fix sharing of mouse button state between mousekeys and ps2_mouse May 19, 2020
@drashna drashna requested a review from a team May 19, 2020 11:25
@manna-harbour manna-harbour changed the title Fix sharing of mouse button state between mousekeys and ps2_mouse Fix sharing of mouse button state from mousekeys to ps2_mouse May 20, 2020
@manna-harbour manna-harbour force-pushed the mousekey-ps2_mouse-buttons branch from d50f0a3 to 11aaa8d Compare June 10, 2020 07:14
@Erovia
Copy link
Member

Erovia commented Jun 26, 2020

Don't you need to call mousekey_send(); for PS2 mousekeys?

@manna-harbour
Copy link
Contributor Author

Thanks for having a look at this.

Don't you need to call mousekey_send(); for PS2 mousekeys?

Actually, that was the problem. With ps2_mouse enabled, action.c and ps2_mouse.c were both sending click events.

Ultimately, it would be nice if mousekeys, ps2_mouse, and pointing_device all had their mouse buttons properly integrated, but just using the code QMK has inherited from TMK and the subsequent attempts to fix it, I believe this is what it should look like. I've been using this daily without issue.

Copy link
Member

@Erovia Erovia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__attribute__ ((weak))
LGTM

@Erovia Erovia requested a review from a team June 30, 2020 19:51
@manna-harbour
Copy link
Contributor Author

__attribute__ ((weak))
LGTM

strong thanks!

tmk_core/common/action.c Outdated Show resolved Hide resolved
With this change, when ps2_mouse is disabled, mousekeys works as usual. With
ps2_mouse enabled, mousekeys button state is shared with ps2_mouse for clicking,
dragging, and scrolling, mousekeys clicks are produced by ps2_mouse only, and
mouskeys button state is transferred to mousekeys without generating clicks to
enable mousekeys dragging.

Co-authored-by: Drashna Jaelre <[email protected]>
@manna-harbour manna-harbour force-pushed the mousekey-ps2_mouse-buttons branch from 11aaa8d to 4743c86 Compare July 2, 2020 03:52
@Erovia Erovia requested a review from a team July 2, 2020 15:10
@Erovia Erovia merged commit d1819f0 into qmk:master Jul 2, 2020
@manna-harbour
Copy link
Contributor Author

Thanks everyone!

@manna-harbour manna-harbour deleted the mousekey-ps2_mouse-buttons branch July 2, 2020 22:39
Shinichi-Ohki added a commit to Shinichi-Ohki/qmk_firmware that referenced this pull request Jul 6, 2020
* 'master' of https://github.com/qmk/qmk_firmware: (154 commits)
  Fix typo in freebsd_install.sh (qmk#9655)
  [Keymap] Add Alice rev2 to my userspace (qmk#9600)
  [Keyboard] RART67 : add support via (qmk#9589)
  [Keyboard] XD87 Caps Lock LED refactor (qmk#9585)
  [Keyboard] Updated VIA Support for DP60 (qmk#9508)
  fixed link to Eclipse instructions (qmk#9647)
  format code according to conventions [skip ci]
  add DIP_SWITCH_MATRIX_GRID support (qmk#8772)
  add SPLIT_HAND_MATRIX_GRID support (qmk#8685)
  [Keyboard] Gowla Macro Board (qmk#9643)
  Fix “G” in Neo2 keymap (qmk#9645)
  Rotr - Updated README and default keymap (qmk#9598)
  Add missing dependency for Void Linux to util/linux-install.sh (qmk#9637)
  Backlight docs wordsmithing (qmk#9631)
  Fix incorrect layout for GHS.rar (qmk#9597)
  Add movement hook to ps2_mouse (qmk#8805)
  Make sendstring respect `TAP_CODE_DELAY` (qmk#9623)
  [Keymap] Adding a Custom Keymap for Matrix Noah (qmk#9581)
  Fix sharing of mouse button state from mousekeys to ps2_mouse (qmk#9124)
  Add xjtian keymap for Planck (qmk#9502)
  ...
jakobaa pushed a commit to jakobaa/qmk_firmware that referenced this pull request Jul 7, 2020
With this change, when ps2_mouse is disabled, mousekeys works as usual. With
ps2_mouse enabled, mousekeys button state is shared with ps2_mouse for clicking,
dragging, and scrolling, mousekeys clicks are produced by ps2_mouse only, and
mouskeys button state is transferred to mousekeys without generating clicks to
enable mousekeys dragging.

Co-authored-by: Drashna Jaelre <[email protected]>

Co-authored-by: Drashna Jaelre <[email protected]>
drashna added a commit to zsa/qmk_firmware that referenced this pull request Aug 9, 2020
With this change, when ps2_mouse is disabled, mousekeys works as usual. With
ps2_mouse enabled, mousekeys button state is shared with ps2_mouse for clicking,
dragging, and scrolling, mousekeys clicks are produced by ps2_mouse only, and
mouskeys button state is transferred to mousekeys without generating clicks to
enable mousekeys dragging.

Co-authored-by: Drashna Jaelre <[email protected]>

Co-authored-by: Drashna Jaelre <[email protected]>
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
With this change, when ps2_mouse is disabled, mousekeys works as usual. With
ps2_mouse enabled, mousekeys button state is shared with ps2_mouse for clicking,
dragging, and scrolling, mousekeys clicks are produced by ps2_mouse only, and
mouskeys button state is transferred to mousekeys without generating clicks to
enable mousekeys dragging.

Co-authored-by: Drashna Jaelre <[email protected]>

Co-authored-by: Drashna Jaelre <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mouse keys messed up for anyone else?
4 participants