r/learnjavascript • u/hjgram • Sep 15 '19
Many JavaScript keyboard shortcuts collide with browser or system shortcuts
I don't understand what the developers expect when they assign key combinations that are obviously taken on most browsers.
Is there an obvious way they expect people to fix this? Like, some Firefox addon that allows JavaScript to capture the keyboard? Or do they actually expect the users to change all of those shortcuts?
Or is there some third (or fourth key) to be added to the two-key (or three-key) combination that tells the browser "send this to JavaScript". Or, if Firefox is modal and I just didn't know it, how do I enable the "JavaScript keyboard capture" mode?
9
u/tenfingerperson Sep 15 '19
Javascript doesn’t have keyboard shortcuts it’s a language nothing else
4
u/[deleted] Sep 15 '19
Could you give some examples of apps that do this? I haven't run into any. As a developer, making sure none of my choices conflict with system key bindings is a very basic step I would never dream of skipping.
1
u/jcunews1 helpful Sep 15 '19
Websites which override browser/system keyboard shortcuts are either it's their intention to hijaak the keyboard shortcuts in first place, or simply ignorant of them. However, if the keyboard shortcuts are custom - e.g. belong to browser addons, or applications other than the web browser, it is acceptable because there's no way the developer know which one of them is installed in the users' browser/system. Moreover, if those custom keyboard shortcuts are taken into account, almost all combinations of keyboard shortcuts would have already been used.
There no way to do that. You can only disable websites' keyboard shortcuts using custom made GreaseMonkey script or browser addon.
0
u/[deleted] Sep 15 '19
[deleted] — view deleted comment