Skip to content

psm(4): Disabled IMEX side-buttons by default.#388

Merged
ericbsd merged 1 commit into
ghostbsd:stable/15from
b-aaz:psm_workaround
Jun 15, 2026
Merged

psm(4): Disabled IMEX side-buttons by default.#388
ericbsd merged 1 commit into
ghostbsd:stable/15from
b-aaz:psm_workaround

Conversation

@b-aaz

@b-aaz b-aaz commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

This is a workaround.
At least two hypervisors (QEMU and VBox) are detected to be using this mouse model by default and they send superfluous side button key events when using the scroll wheel.

Added a runtime rw sysctl that disables the side buttons on this specific model to workaround this issue.

This issue was also mentioned by users in discussions.
Links to some of other mentions of this issue I have found:
https://forums.freebsd.org/threads/gnome3-weird-scroll-wheel-behaviour.78532/
https://www.reddit.com/r/freebsd/comments/o8k71l/anyone_else_having_weird_behaviour_with_scrolling/

Summary by Sourcery

Disable Intellimouse Explorer side buttons by default via a runtime sysctl to avoid spurious button events from this mouse model.

Bug Fixes:

  • Work around hypervisors sending spurious Intellimouse Explorer side button events when using the scroll wheel.

Enhancements:

  • Add a runtime rw sysctl to allow enabling Intellimouse Explorer side buttons when desired.

This is a workaround.
At least two hypervisors (QEMU and VBox) are detected to be using this
mouse model by default and they send superfluous side button key events
when using the scroll wheel.

Added a runtime rw sysctl that disables the side buttons on this
specific model to workaround this issue.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
@b-aaz b-aaz requested review from a team as code owners June 14, 2026 18:26
@sourcery-ai

sourcery-ai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a tunable/sysctl to control Intellimouse Explorer side-button handling and defaults it to disabled to work around spurious side-button events from some hypervisors, altering the packet-processing path for that mouse model.

Sequence diagram for runtime control of explorer_sidebuttons via sysctl

sequenceDiagram
  actor Admin
  participant SysctlInterface
  participant Kernel_psm as Kernel_psm

  Admin->>SysctlInterface: sysctl hw.psm.explorer_sidebuttons=1
  SysctlInterface->>Kernel_psm: update explorer_sidebuttons
  Admin->>Kernel_psm: mouse input arrives
  Kernel_psm->>Kernel_psm: psmsoftintr processes Explorer packet
  Kernel_psm-->>Admin: side button events generated (if explorer_sidebuttons != 0)
Loading

File-Level Changes

Change Details Files
Introduce a runtime sysctl to enable/disable Intellimouse Explorer side buttons and gate side-button event processing on it, defaulting to disabled.
  • Add a new global flag variable for Intellimouse Explorer side-button support, initialized to disabled
  • Expose the flag as a writable hw.psm.explorer_sidebuttons sysctl so behavior can be toggled at runtime
  • Short-circuit the Intellimouse Explorer packet parsing path so that side-button events are not generated when the sysctl is disabled
sys/dev/atkbdc/psm.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

Copy link
Copy Markdown

Thank you for taking the time to contribute to FreeBSD!
There is an issue that needs to be fixed:

  • Real email address is needed18d8a1f

Please review CONTRIBUTING.md, then update and push your branch again.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • To match nearby sysctl usage and keep this tunable controllable both at boot and at runtime, consider using CTLFLAG_RWTUN for explorer_sidebuttons instead of plain CTLFLAG_RW.
  • Align the if (!explorer_sidebuttons) brace style with the file’s KNF convention (opening brace on the same line as the if) for consistency with surrounding code.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- To match nearby sysctl usage and keep this tunable controllable both at boot and at runtime, consider using CTLFLAG_RWTUN for `explorer_sidebuttons` instead of plain CTLFLAG_RW.
- Align the `if (!explorer_sidebuttons)` brace style with the file’s KNF convention (opening brace on the same line as the `if`) for consistency with surrounding code.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ericbsd ericbsd merged commit 2864dbd into ghostbsd:stable/15 Jun 15, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Development Tracker Jun 15, 2026
@ericbsd

ericbsd commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This will need to be tested before back-porting to releng/15.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants