StylishThemes / GitHub-Dark-Script

Archived - Please use https://github.com/StylishThemes/GitHub-Dark directly
https://greasyfork.org/en/scripts/15562
MIT License
549 stars 51 forks source link

Shortcuts dont work #34

Open ShalokShalom opened 7 years ago

ShalokShalom commented 7 years ago

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

Mottie commented 7 years ago

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 commented 7 years ago

Is this still an issue?

ShalokShalom commented 7 years ago

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.

Mottie commented 7 years ago

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?

ShalokShalom commented 7 years ago

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 commented 7 years ago

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.

Mottie commented 7 years ago

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).

ShalokShalom commented 7 years ago

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

Mottie commented 7 years ago

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.

ShalokShalom commented 7 years ago

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

Mottie commented 7 years ago

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.

ShalokShalom commented 7 years ago

And now? I also set document.body

Mottie commented 7 years ago

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?

ShalokShalom commented 7 years ago

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.

Mottie commented 7 years ago

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

ShalokShalom commented 7 years ago

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