olivierdagenais / tampermonkey-copy-url

A Tampermonkey userscript to copy nice-looking URLs to the clipboard.
MIT License
0 stars 0 forks source link

feat: support FR-CA keyboard on Windows 10 #50

Closed olivierdagenais closed 5 months ago

olivierdagenais commented 5 months ago

I occasionally use the "French (Canada) Canadian French keyboard" layout on Windows 10 computers: image

But when I try to copy URLs in Textile or HTML format, nothing happens. The browser never sees that Ctrl & Alt are held when the third key is o or p; it just thinks I have these characters directly on my keyboard. The solution is to accept those keys as shortcuts directly. The difficulty is the compiler doesn't seem to handle UTF-8 so I had to use the \u#### notation.

Fixes #41

Manual testing

GIVEN

I have temporarily configured my browser with the output of ./docker_node npm run build AND I go to the page https://github.com/olivierdagenais/tampermonkey-copy-url/issues/41

WHEN

I hit Ctrl+Alt+o while in FR-CA mode.

THEN

I get the Textile version copied to my clipboard:

[olivierdagenais/tampermonkey-copy-url#41: French Canadian keyboard sends special characters for some key-combinations|https://github.com/olivierdagenais/tampermonkey-copy-url/issues/41]

WHEN

I hit Ctrl+Alt+p while in FR-CA mode.

THEN

I get the HTML version copied to my clipboard:

<html><head></head><body><a href="https://github.com/olivierdagenais/tampermonkey-copy-url/issues/41">olivierdagenais/tampermonkey-copy-url#41: French Canadian keyboard sends special characters for some key-combinations</a></body></html>

Mission accomplished!