Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Keyboard for other languages #203

Open
Moby812 opened this issue Dec 7, 2024 · 20 comments
Open

Add Keyboard for other languages #203

Moby812 opened this issue Dec 7, 2024 · 20 comments

Comments

@Moby812
Copy link

Moby812 commented Dec 7, 2024

Hello!
Is it possible to add keyboard layouts for other languages? For example, Cyrillic?

@XITRIX
Copy link
Owner

XITRIX commented Dec 7, 2024

Russian keyboard is already there (it's Cyrillic), also I think it should be quite easy to create new keyboards (I've made them about 2 years ago, don't remember clearly). If remember properly, I made them with new keyboards in mind
IMG_8410
IMG_8411

UP.
Ok ... I forgot about it and it's not very obvious, Russian keyboard only available with "Full-sized" keyboard type option enabled, compact is only English one

@Moby812
Copy link
Author

Moby812 commented Dec 7, 2024

Thank you, I didn't know that it was already implemented.
And then is it possible to add this layout switcher to the "compact" keyboard? (It is only available in the full-size one)

Only after writing a new comment did I see that there was more text under the screenshot)

@Moby812
Copy link
Author

Moby812 commented Dec 7, 2024

Is it possible to add the ability (by specifying in the settings which key combination is used) to change the layout on the computer itself?
And for example, by this specified button, the layout on the computer will switch and the virtual keyboard will switch to a previously specified language (from Russian to English and back. Without opening a submenu).

@XITRIX
Copy link
Owner

XITRIX commented Dec 8, 2024

You can press "alt shift" on virtual keyboard to switch it on host, like you do it on real keyboard.

Switching keyboards without menu is a nice point, but I'm afraid it will require a lot of time to make it properly, while moonlight was never about "typing", it's about gaming, and this keyboard is more like a nice bonus than a core feature, so probably I will not implement it any time soon (but I like an idea, so it's not impossible)

@Moby812
Copy link
Author

Moby812 commented Dec 8, 2024

Thank you very much!
I understand perfectly well that this is a low priority task)
But if I ever get around to it, I would be so happy)

@moi952
Copy link

moi952 commented Jan 4, 2025

You can press "alt shift" on virtual keyboard to switch it on host, like you do it on real keyboard.

Switching keyboards without menu is a nice point, but I'm afraid it will require a lot of time to make it properly, while moonlight was never about "typing", it's about gaming, and this keyboard is more like a nice bonus than a core feature, so probably I will not implement it any time soon (but I like an idea, so it's not impossible)

Isn't there a library that allows you to recover ready-made keyboards?
It's true that it would be practical to have my keyboard in French 😜

Maybe using https://github.com/keymanapp/keyman would make it faster?

@XITRIX
Copy link
Owner

XITRIX commented Jan 4, 2025

Looks like I didn't thought about it 3 years ago :D
Btw thanks for the library, looks nice, but I'm afraid app is already at that point, where it will be quite hard to replace current keyboard with something else. Anyway with current keyboard implementation should be quite easy to create new keyboard layout. I need to find some time to implement layout builder, so anyone could contribute their keyboard to the project

P.S.
Is this how French keyboard looks like? I could try to implement it as an example for layout builder
image

@moi952
Copy link

moi952 commented Jan 4, 2025

Looks like I didn't thought about it 3 years ago :D Btw thanks for the library, looks nice, but I'm afraid app is already at that point, where it will be quite hard to replace current keyboard with something else. Anyway with current keyboard implementation should be quite easy to create new keyboard layout. I need to find some time to implement layout builder, so anyone could contribute their keyboard to the project

P.S. Is this how French keyboard looks like? I could try to implement it as an example for layout builder image

It's a French macbook keyboard.
Thanks you're great 😀

This is a french keyboard :

clavier fr

@XITRIX
Copy link
Owner

XITRIX commented Jan 4, 2025

image Ok, actually it should be really easy to add new keyboard, just populating new KeyboardLocale to locales array

@moi952
Copy link

moi952 commented Jan 4, 2025

image

Ok, actually it should be really easy to add new keyboard, just populating new KeyboardLocale to locales array

We can use chatGpt for that 😁

@XITRIX
Copy link
Owner

XITRIX commented Jan 4, 2025

UP.

No ... I want to cry, French keyboard literally moves VK_Keycodes around, looks like it's just coincidence that Russian keyboard uses 1:1 the same layout as UK keyboard, while AZERTY keyboards moves buttons around (not just labels of keys)

Looks like I'll need to have codes localized as well
image

Or make a mapper, which will tell if buttons need to be swapped, like "VK_KEY_W -> VK_KEY_Z"

@XITRIX
Copy link
Owner

XITRIX commented Jan 4, 2025

image Is this layout looks correct?

@moi952
Copy link

moi952 commented Jan 4, 2025

image Is this layout looks correct?

Yes it is good

XITRIX added a commit that referenced this issue Jan 4, 2025
@XITRIX
Copy link
Owner

XITRIX commented Jan 4, 2025

IMG_9765
IMG_9766

Here we go

Test if all buttons works properly, please:
https://github.com/XITRIX/Moonlight-Switch/actions/runs/12612806364

@moi952
Copy link

moi952 commented Jan 5, 2025

I'll give you a clearer feedback (and written on the right ticket) on the French keyboard

  1. The keyboard is always QWERTY when in French. If I press “A”, a “Q” is typed, and so on.
  2. The Espace and Suppr keys seem to be translated, but for example, “espace” remains “espace” on the French keyboard when it should be “espace” according to the translations.
  3. The Caps Lock key does not lock capital letters. The Shift key does (the two keys seem to work in reverse).

@XITRIX
Copy link
Owner

XITRIX commented Jan 6, 2025

About Caps Lock, it behave as a regular button, it's only your Host who knows real state of Caps Lock and actually it could get desynchronized with Moonlight, so probably you have correct behaviour of Caps Lock

Shift is locking locally on Moonlight for easier typing in uppercase (to not force user to hold Shift while typing)

@XITRIX
Copy link
Owner

XITRIX commented Jan 7, 2025

@moi952, fixed keyboard layout, check it pls
https://github.com/XITRIX/Moonlight-Switch/actions/runs/12642639448

@moi952
Copy link

moi952 commented Jan 7, 2025

@moi952, fixed keyboard layout, check it pls https://github.com/XITRIX/Moonlight-Switch/actions/runs/12642639448

First of all, thanks for your work on Moonlight-Switch, it's really great! 😊
French keyboard works perfectly!

I noticed a bit of a peculiar behavior regarding Caps Lock and Shift on the touch keyboard:

The Caps Lock key does indeed trigger the caps lock on the PC, but there is no visual feedback in the interface, which can make its usefulness limited.
The Shift key works differently from mobile keyboards: a single click locks it and puts the keyboard in capital letters, while on mobile, this action usually requires a double click.

Maybe it would be more intuitive:

  • To remove or rethink Caps Lock, given the lack of visual feedback on its state.

  • To align Shift behavior with that of classic touch keyboards:

    - A single click for a temporary capital letter.
    - A double click to lock Shift and display the keyboard in capital letters.
    

What do you think?

EDIT : The "Delete" button doesn't work, well it's useless. You can map it to "Remove" if you want.

@XITRIX
Copy link
Owner

XITRIX commented Jan 7, 2025

About CapsLock, there is no way to have any kind of visual feedback to it, because Moonlight has no idea about it's current state on Host (and it's pretty bad idea to try to guess it), also in Windows you can reassign CapsLock key to any other button, so it should behave as regular CapsLock key to perform correctly

Shift on the other hand could have visual feedback, because I can simulate it's lock position, by sending "key pressed" without "key released" event.

About Shift's behavior I would agree that it could be improved, but it would make keyboard implementation much more complex, Moonlight was never about typing essays, it's about playing games, and keyboard is just an accessibility tool, that could help you to perform some tasks during game sessions (like enter password, or respond in the chat), so I just don't want to spend a lot of time on it

P.S. "Delete" button works, it deletes to forward, not backward as "Remove"

@moi952
Copy link

moi952 commented Jan 7, 2025

About CapsLock, there is no way to have any kind of visual feedback to it, because Moonlight has no idea about it's current state on Host (and it's pretty bad idea to try to guess it), also in Windows you can reassign CapsLock key to any other button, so it should behave as regular CapsLock key to perform correctly

Shift on the other hand could have visual feedback, because I can simulate it's lock position, by sending "key pressed" without "key released" event.

About Shift's behavior I would agree that it could be improved, but it would make keyboard implementation much more complex, Moonlight was never about typing essays, it's about playing games, and keyboard is just an accessibility tool, that could help you to perform some tasks during game sessions (like enter password, or respond in the chat), so I just don't want to spend a lot of time on it

P.S. "Delete" button works, it deletes to forward, not backward as "Remove"

Yes yes I completely understand you are not going to spend time on 0.000001% of the use of moonlight switch.
I have sent the information back in case it was simple and quick to implement.

Thank you very much 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants