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

[Windows] VK_BROWSER_FORWARD switches tabs and is not configurable #8604

Open
cariad-robert-abel opened this issue Jul 22, 2020 · 1 comment

Comments

@cariad-robert-abel
Copy link

cariad-robert-abel commented Jul 22, 2020

Description of the Issue

I have a HP laptop that comes with a Synaptics Touch Pad as well as a Trackball located between the G, H, and B keys.
Whenever the trackball is used (or even slightly brushed) it will move the mouse pointer (expected) but also switch to the next tab right of the current tab or to the first tab if the last tab is currently open.
This happens in Notepad++ v7.7.1 as well as v7.8.9.

Naturally, this is very bothersome as one in twenty words will change tabs while typing.

Technical Description of the Issue

The HP laptop uses a Synaptics Touch Pad with Trackball. I use driver 19.5.9.5 from 07 Dec 17 supplied by Microsoft Windows Hardware Compatibility Publisher via Windows Update.

On every use of the trackball it sends the following sequence of virtual keys: VK_BROWSER_FORWARD followed by VK_BROWSER_STOP. See screenshot of Nirsoft KeyboardStateView below:
KeyboardStateViewer

Steps to Reproduce the Issue

  1. Have multiple tabs open in Notepad++.
  2. Move Trackball.

Expected Behavior

Notepad++ should ignore this weird key combination and do nothing.
This is what Internet Explorer, Mozilla Firefox, Windows Explorer etc. do.

Actual Behavior

Notepad++ switches to the next tab.

Debug Information

Notepad++ v7.8.9 (32-bit)
Build time : Jul 15 2020 - 20:26:50
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1803
OS Build : 17134.1550
Current ANSI codepage : 1252
Plugins : none

What I tried

I looked through the source code and saw that there exist various shortcuts using CTRL + [SHIFT +] PgDown to switch to the next tab. I disabled all these in the Settings --> Shortcut Mapper... menu.
Specifically, I removed these shortcuts:

  • Main Menu: Next Tab
  • Main Menu: Previous Tab
  • Main Menu: Move Tab Forward
  • Main Menu: Move Tab Backward
  • Scintilla commands: SCI_PAGEDOWN
  • Scintilla commands: SCI_PAGEDOWNEXTEND
  • Scintilla commands: SCI_PAGEDOWNRECTEXTEND

I restarted Notepad++ in-between sessions. I disabled all plugins to rule out that any of the plugins actually listens to this key sequence. This did not help.

What helped

I found an updated Synaptics Touchpad Driver on the HP FTP:

  • sp94796.exe at ftp://ftp.hp.com/pub/softpaq/sp94501-95000/sp94796.exe
  • Readme at ftp://ftp.hp.com/pub/softpaq/sp94501-95000/sp94796.html

This driver is version 19.5.9.26 from 10 Oct 2018 published by Synaptics Incorporated.
This solves my issue, because it just does not send the evil key sequence anymore. However, I feel that this merely works around the issue and it should be fixed in Notepad++ as well.

Miscellaneous

The keyboard and touchpad are not by the same vendor, but are both connected through virtual PS/2 ports, so I suspect a connection.
EDIT: I confirmed this suspicion: using the new Synaptics driver also made these spurious key sequences go away.

I noticed that sometimes when pressing many keys at once on my keyboard (rollover?) while also using multiple fingers on the touch pad the VK_BROWSER_FORWARD and VK_BROWSER_STOP sequence is sent as well:

KeyboardStateViewer_Rollover

Notice how VK_LWIN is included in this list, but neither did I press the physical left Windows key nor did the Windows Start menu actually open. This press seems to be purely initiated by the number of fingers on the touch pad while "stressing" the keyboard.

The VK_BROWSER_FORWARD and VK_BROWSER_STOP sequence is also sent every time I use the physical Windows key on the keyboard:
KeyboardStateViewer_WinKey

@alankilborn
Copy link
Contributor

FWIW, I wrote a PythonScript that intercepts the WM_APPCOMMAND message looking for APPCOMMAND_BROWSER_FORWARD and APPCOMMAND_BROWSER_BACKWARD to be commanded.

I then make them do other functions, but they could just as easily be disabled by removing the line of code that does these other functions.

See https://community.notepad-plus-plus.org/topic/13149 for detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants