MozillaZine

Shift Crl Alt keys on macs & linux

Discuss building things with or for the Mozilla Platform.
nonat
 
Posts: 145
Joined: November 5th, 2013, 10:54 am

Post Posted December 3rd, 2013, 8:46 pm

hey im making a toolbar button addon using these qualifers to open links, and wanto know what keys you press on macs and linux to have event.ctrlKey, event.shiftKey and event.altKey do what they do on windows. I see theres also an event.metaKey option supposedly related to macs and/or linux, would that be the alternative for one of those three, would it be the mac command key?

also whats the middle click equivalent on macs? do they have one, am only aware the common method on windows laptops to enable middle click is to have it respond to a left+right button click

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted December 3rd, 2013, 8:57 pm

Documentation here:
https://developer.mozilla.org/en-US/doc ... boardEvent

Command+click = middle-click on OSX

Ctrl+click = middle-click on Windows/Linux
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

nonat
 
Posts: 145
Joined: November 5th, 2013, 10:54 am

Post Posted December 3rd, 2013, 9:10 pm

hey patrick, thats really confusing, middle clicks like a click, how can a click also be a qualifier?

what i mean is atm i have the buttons rigged to respond to middle click + Ctrl , middle click + Shift and middle click + Alt

so how could Ctrl+click = middle click? thatd be like trying to write the script Ctrl+click + Ctrl

the specific syntax im talking about is

Code: Select all
if(event.button == 1 && event.ctrlKey) etc

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted December 3rd, 2013, 9:22 pm

I don't think you can/should have Ctrl+middle-click. Ctrl+click is reserved for simulating middle-click on mice that lack a middle button. So how will your shortcut work for those users?
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

nonat
 
Posts: 145
Joined: November 5th, 2013, 10:54 am

Post Posted December 3rd, 2013, 10:16 pm

ok so if someones mouse needs to use ctrl+ click to simulate middle click, guess it means they could only do Ctrl+click+Shift or Ctrl+click+Alt, does that seem correct?

but it wouldnt cause a problem either way as the script doesnt have a default middle click behavior, so if the two examples above work fine, otherwise also fine, and triggers are only when hovering over the buttons, not affecting anything else in the browser

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted December 3rd, 2013, 10:26 pm

Yes I think so.

Just remember that your OSX users will need Command+click for middle-click simulation, and Control+click for right-click simulation (context menus) so your options are even more limited there.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

nonat
 
Posts: 145
Joined: November 5th, 2013, 10:54 am

Post Posted December 3rd, 2013, 10:48 pm

thanks patrick, i know it must hurt having to talk about toolbar addons so much appreciated, and will try to make my next project about something else :)

Return to Mozilla Development


Who is online

Users browsing this forum: No registered users and 1 guest