Closed Bug 1254449 Opened 9 years ago Closed 9 years ago

onContextMenu: event.ctrlKey, event.shiftKey, event.AltKey will always be false under Linux

Categories

(Firefox :: Untriaged, defect)

44 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: Chris78, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 2016021000

Steps to reproduce:

Check the attached example.

Watch the value of event.ctrlKey when right-clicking while holding down ctrl-key.


Actual results:

If you right-click while holding down ctrl-key under Windows the example will log "event.ctrlKey = true" to the console. Under Linux however it will log "event.ctrlKey = false".

The same applies to the other modifier keys (shift and alt).


Expected results:

Under Linux the states of modifier keys should be correct, so I expect to be event.ctrlKey = true within the oncontextmenu event, if the ctrl key is held down while right clicking.
I can't reproduce this issue - event.ctrlKey does log 'true' when the ctrl key is pressed on my linux VM.

Can you try reproducing on a clean profile and/or using an official mozilla.org build ( https://www.mozilla.org/firefox/all ) ?
Component: General → Untriaged
Flags: needinfo?(cgerharz)
Oh, sorry for that. I could now find the AddOn responsible for that behavior: It was FireGestures. 

After deactivating the AddOn my example attachment works as expected again.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(cgerharz)
Resolution: --- → INVALID
Oh, I already filed an issue on GitHub for FireGestures AddOn.
If someone wants to track this issue, here's the link:
https://github.com/gomita/firegestures/issues/110
this issue has to be reopen, it is totally accurate and on a fresh profile with no addons (well, greasemonkey and ublock)


what i did :

a contextmenu with menuitems (like here https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menuitem)

added a "click" event listener on the menuitem

clicked on the menuitem and got the listener function called, logging the event.ctrlKey and event.shiftKey


what i got :

the event.ctrlKey and event.shiftKey are false whatever i hold or not the shift and/or ctrl key down while clicking the menuitem


what i expected :

the event.ctrlKey and event.shiftKey to be true or false according if i hold then down or not while clicking the menuitem


i'll had a jsfiddle later or something
(In reply to roger21 from comment #4)
> this issue has to be reopen, it is totally accurate and on a fresh profile
> with no addons (well, greasemonkey and ublock)
> 
> 
> what i did :
> 
> a contextmenu with menuitems (like here
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menuitem)
> 
> added a "click" event listener on the menuitem
> 
> clicked on the menuitem and got the listener function called, logging the
> event.ctrlKey and event.shiftKey
> 
> 
> what i got :
> 
> the event.ctrlKey and event.shiftKey are false whatever i hold or not the
> shift and/or ctrl key down while clicking the menuitem
> 
> 
> what i expected :
> 
> the event.ctrlKey and event.shiftKey to be true or false according if i hold
> then down or not while clicking the menuitem
> 
> 
> i'll had a jsfiddle later or something

This bug wasn't about the click on the context menu item, but about the right-click that brings up the context menu in the first place (which causes an oncontextmenu event). So what you're seeing is a different thing than what this bug reported.

You could file a separate bug, but the plan is to remove support for HTML <menuitem> at some point (there are unfinished patches in bug 1372276) given it's no longer in the spec and other browsers don't support it - so I'm afraid I don't think we'd fix the bug if filed.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: