Page up/down behaviour changes to "page back/forward"

RESOLVED FIXED in Firefox 46

Status

()

Core
Widget: Win32
--
major
RESOLVED FIXED
6 years ago
4 months ago

People

(Reporter: Dmitry, Assigned: karlt)

Tracking

({regression})

10 Branch
mozilla46
x86_64
Windows 7
regression
Points:
---

Firefox Tracking Flags

(firefox46 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0
Build ID: 20120129021758

Steps to reproduce:

After starting Firefox, the Page Up/Down keys work fine at first. Ctrl + Page Up/Down cycles tabs and Page Up/Down scroll the current page. But after all the keys are released for the first time the behaviour is broken: pressing Page Up/Down cycles through the tab's history (back and forward, respectively) and Ctrl + Page Up/Down does nothing.

Because of this, page scrolling is a nightmare, since Page Up/Down have a different behaviour than expected from any program.

The Ctrl key is not the problem, because it still behaves properly. Ctrl + t/c/v/x still work as expected.

All add-ons have been disabled. Page Up/Down work as usual in other programs (Opera, Chrome, Notepad++, etc).
I experienced this behaviour for the first time in Firefox since version 4.0 till the current 10.0
I have a notebook with "Windows 7 SP1 x64" and touchpad "ELAN PS/2 Port Smart-Pad" with the only available driver version 7.0.5.9 (release date oct 15 2009)


Actual results:

Page up/down behaviour changes to "page back/forward"


Expected results:

Page up/down should scroll the page up/down respectively
(Reporter)

Updated

6 years ago
Severity: normal → major
Component: Untriaged → Keyboard Navigation
Keywords: regression
See Also: → bug 640587

Comment 1

6 years ago
This appears to be the same issue as in 640587.  That thread contains a work-around for the problem through changing the setting of a hack (below).  This is a work-around not a fix.  I have an ASUS UL30 running Windows 7 64 bit and Firefox 10.0.2 which showed the same problem until I changed the value listed below.  Firefox users with laptops using this type of touchpad should not have to search the internet for this work-around.  Either the problematic default hack setting needs to be changed, or a fix written.

dmtf2010@yandex.ru 2011-05-25 05:24:38 PDT wrote:

So, the solution is:
1. Go to about:config
2. Find ui.elantech_gesture_hacks.enabled
3. Change its value from -1 to 0
4. Restart FF
5. If you run into a bug that option was designed to fix (non-working page swipe gestures), install the latest Elantech driver (http://www.techspot.com/drivers/driver/file/information/14513/) and reboot.

Comment 2

6 years ago
"Firefox users with laptops using this type of touchpad should not have to search the internet for this work-around." -the_harper

Agreed.

Updated

6 years ago
QA Contact: untriaged → keyboard.navigation

Comment 3

3 years ago
Broken again in 38.0.5.  Was fine until updating from 37 to 38.

Toggling F7 on and off again didn't change the behavior.  Restarting the browser in Safe Mode didn't change the behavior.  Toggling the gesture-hacks flag didn't change the behavior.
(Assignee)

Comment 4

2 years ago
I see this bug on a Dell laptop where the ELAN tab of Mouse Properties dialog
on Windows 7 says: Driver Version: ETDWare PS/2-x64 7.0.4.12_14Jul09_WHQL

The keyboard has dedicated Page Up/Down keys, which demonstrate this bug
without touching the function key, but can also generate Page Up/Down with
Fn + Up/Down, which also demonstrate this bug.  I suspect the dedicated keys may
be triggering the same virtual key sequence as Fn + Up/Down.

http://stackoverflow.com/questions/4718069/what-is-win32-virtual-key-code-0xff-used-for-and-is-it-documented-somewhere#comment5219075_4718319
reports Page Down generating a key sequence including virtual 0xFF.

Disabling activation of the hack with the 0xFF virtual key allows concurrently
the Page Up/Down keys to work as Page Up/Down and the three finger swipe to
trigger page back/forward.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=73ba1cc70d71
Status: UNCONFIRMED → NEW
Component: Keyboard Navigation → Widget: Gtk
Ever confirmed: true
Product: Firefox → Core
(Assignee)

Updated

2 years ago
Component: Widget: Gtk → Widget: Win32
(In reply to Karl Tomlinson (ni?:karlt) from comment #4)
> The keyboard has dedicated Page Up/Down keys, which demonstrate this bug
> without touching the function key, but can also generate Page Up/Down with
> Fn + Up/Down, which also demonstrate this bug.  I suspect the dedicated keys
> may
> be triggering the same virtual key sequence as Fn + Up/Down.

Your suspicion makes sense, but I wonder what this change would do for devices with versions of the driver that only generate 0xCC, and not 0xFF, if such devices still exist.  (I didn't record which versions of the driver used which of these two modifiers, unfortunately.)
(Assignee)

Comment 6

2 years ago
Created attachment 8704483 [details] [diff] [review]
don't activate ELAN swipe hack with 0xFF virtual key

On some hardware, it is not possible to distinguish 0xFF from the function
key, which is required to generate or artificially generated with Page Up or
Page Down on some keyboards.  This change permits Page Up and Page Down keys
to function as expected on this hardware.
Attachment #8704483 - Flags: review?(cam)
(Assignee)

Updated

2 years ago
Assignee: nobody → karlt
Status: NEW → ASSIGNED
I'm curious whether the touchpad supports the three finger swipe gestures, and if so, whether the generated keycodes for Page Up/Down differ from those for the swipe.  I worry that disabling checking for 0xFF will just break swiping for some users.  So if you can list the WM_KEY* events generated for (a) pressing the dedicated Page Up/Down keys, (b) pressing Fn+Up/Down, (c) performing the swipe gestures, we might be able to find a more targetted check.
Flags: needinfo?(karlt)
(Assignee)

Updated

2 years ago
Blocks: 593372
(Assignee)

Comment 8

2 years ago
Page Down and Page Up keys or combinations generate:

P WM_KEYDOWN nVirtKey:VK_NEXT cRepeat:1 ScanCode:51 fExtended:1 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:VK_NEXT cRepeat:1 ScanCode:51 fExtended:1 fAltDown:0 fRepeat:1 fUp:1
P WM_KEYDOWN nVirtKey:VK_PRIOR cRepeat:1 ScanCode:49 fExtended:1 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:VK_PRIOR cRepeat:1 ScanCode:49 fExtended:1 fAltDown:0 fRepeat:1 fUp:1

There are no events for key 00FF whether or not the physical key used to
generate Page Up / Page Down requires the function key.

I don't know why GetKeyState(0xFF) is returning with the highest bit set.
0xFF is not really a defined key so I don't know what this is expected to
return.

Three finger swipe left and swipe right generate:

P WM_KEYDOWN nVirtKey:00CC cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYDOWN nVirtKey:VK_PRIOR cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:VK_PRIOR cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
P WM_KEYUP nVirtKey:00CC cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
P WM_KEYDOWN nVirtKey:00CC cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYDOWN nVirtKey:VK_NEXT cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:VK_NEXT cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
P WM_KEYUP nVirtKey:00CC cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1

What looks helpful here is that the ScanCode is zero for the synthesized
events, so I expect we can use that to distinguish.
Flags: needinfo?(karlt)
(Assignee)

Updated

2 years ago
Attachment #8704483 - Attachment is obsolete: true
Attachment #8704483 - Flags: review?(cam)
(Assignee)

Comment 9

2 years ago
Created attachment 8704995 [details] [diff] [review]
don't activate ELAN swipe hack unless ScanCode is zero

On some hardware, GetKeyState(0xFF) returns negative even when Elantech
messages are not involved.  This change permits Page Up and Page Down keys
to function as expected on this hardware.
Attachment #8704995 - Flags: review?(cam)
Comment on attachment 8704995 [details] [diff] [review]
don't activate ELAN swipe hack unless ScanCode is zero

Review of attachment 8704995 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, looks good.  I dug out the EeePC that I originally used for testing the Elantech stuff, and with driver version 7.0.4.3 obtained from Asus (not sure if they customised it) 0xFF keys are generated but also with scan code 0.
Attachment #8704995 - Flags: review?(cam) → review+
And the VK_PRIOR/NEXT key messages have scan code 0 too.
(Assignee)

Comment 13

2 years ago
Thanks.  Noted that driver version in the comment.

Comment 14

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/512d9c5b5788
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox46: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46

Comment 15

10 months ago
This is still breaking in 52.0.1 under 64-bit Windows 10.

I have no touchpad, no Elantech driver, and "ui.elantech_gesture_hacks.enabled" was already set to 0 in an attempt to work around this annoying bug.

Comment 16

4 months ago
Workaround:

Use Space and Shift+Space to scroll one page up or down
You need to log in before you can comment on or make changes to this bug.