GitHub-Dark-Script icon indicating copy to clipboard operation
GitHub-Dark-Script copied to clipboard

Shortcuts dont work

Open ShalokShalom opened this issue 8 years ago • 16 comments

Shortcurts like "Press g, then 0/- within one second of each other." make the zoom larger/smaller here in Opera.

ShalokShalom avatar Jun 15 '17 11:06 ShalokShalom

Hi @ShalokShalom!

I just tested this on Opera 45.0.2552.898 (PGO) on a Windows 10 64-bit system and the shortcuts are working for me.

From your other issue I'm guessing you see this issue in Opera for KaOS? With two reported issues, I'm wondering if the userscript manager is working as expected?

Mottie avatar Jun 15 '17 15:06 Mottie

Is this still an issue?

Mottie avatar Jun 21 '17 12:06 Mottie

It works now, while g- does also disable the dark theme at all now. Same thing in Firefox, while it does not zoom even there.

ShalokShalom avatar Jun 21 '17 13:06 ShalokShalom

Sorry for the delay in followup... would you please elaborate on what this means:

Same thing in Firefox, while it does not zoom even there.

I don't know what you mean about it not zooming?

If everything works, can I close this issue?

Mottie avatar Jul 05 '17 22:07 Mottie

In Firefox, g- disables the theme, while your wiki means, its supposed to enable the settings menu: https://github.com/StylishThemes/GitHub-Dark-Script/wiki#enable-github-dark

ShalokShalom avatar Jul 06 '17 10:07 ShalokShalom

Same thing in Opera, while it zooms out there as well. So Page zoom out plus disablement of the Script, instead of an access to the settings.

ShalokShalom avatar Jul 06 '17 10:07 ShalokShalom

I can not duplicate what you're describing... are only the g and - keys being pressed – separately but within one second of each other? Are you using the keypad - or the one in the number row? It shouldn't matter, but I'm asking just in case.

The only way I get the zoom to work is if I hold down the Ctrl key (Windows).

Mottie avatar Jul 06 '17 11:07 Mottie

within one second of each other and the number row, possible just on Linux

ShalokShalom avatar Jul 10 '17 16:07 ShalokShalom

Would you try editing the userscript and try some different key combinations?

Look at lines 36-37 and modify them as desired:

// Keyboard shortcut to open ghd panel (only a two key combo coded)
keyboardOpen = "g+0",
keyboardToggle = "g+-",

It's not set up to allow you to enter stuff like "ctrl+F1", just single letters and numbers.

If it isn't the keys themselves, maybe it is because the script is bound to the document (see line 973) and listening for "keypress" and "keydown"... Maybe try switching that to document.body and see if that fixes the problem.

on(document.body, "keypress keydown", event => {

Sorry I can't be of more help... I don't have any systems running Linux to test these changes.

Mottie avatar Jul 10 '17 17:07 Mottie

I changed it to g+b and g+f and it doesnt do anything on Grease at Firefox now: screenshot_20170710_203744

ShalokShalom avatar Jul 10 '17 18:07 ShalokShalom

Sorry for not getting back to you on this issue. It sounds like Linux is interfering with the script. I don't have any way to troubleshoot and solve this problem.

Mottie avatar Sep 01 '17 12:09 Mottie

And now? I also set document.body

ShalokShalom avatar Sep 01 '17 21:09 ShalokShalom

I was trying to ask that if you're still using this script, are you able to troubleshoot the event listener?

Are the "keypress" or "keydown" events firing? I just updated the script to check the event.key instead of processing event.which. Maybe that will fix the issue? If not, would you please add a console.log after the changed line to see what key is being reported?

Mottie avatar Sep 01 '17 23:09 Mottie

I use the current Github version 2.2.7 and its still happening. Can you give me a specific command? Under which specific line?

NOTE: As stated: g/- as an example work, in the wa that it triggers the Script on and off. The zoom out happens additionally.

ShalokShalom avatar Sep 02 '17 06:09 ShalokShalom

And what happens when you switch the keys to "g+b" and "g+f"?

Mottie avatar Sep 02 '17 12:09 Mottie

https://github.com/StylishThemes/GitHub-Dark-Script/issues/34#issuecomment-314196630

ShalokShalom avatar Sep 02 '17 12:09 ShalokShalom