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

Adding Custom letters to cap lock in Custom layout? #821

Open
GitAlasGo opened this issue Dec 10, 2024 · 7 comments
Open

Adding Custom letters to cap lock in Custom layout? #821

GitAlasGo opened this issue Dec 10, 2024 · 7 comments

Comments

@GitAlasGo
Copy link

GitAlasGo commented Dec 10, 2024

I didn't find a discussion tab here so i made this issue.

How do i configure a custom letter for when i turn on the cap lock?

For example, i want for the letter "q" to turn into letter "P" instead of "Q"

I would think this is the right place to add it?

<key key0="q" key2="1" key4="loc esc"/>
@Spike-from-NH
Copy link
Contributor

Spike-from-NH commented Dec 10, 2024

I think you need a modmap for SHIFT.

Read https://github.com/Julow/Unexpected-Keyboard/blob/master/doc/Custom-layouts.md#Modmap

I believe that CAPS LOCK performs a SHIFT on alphabetic characters only and that you can't control it separately.

@GitAlasGo
Copy link
Author

I think you need a modmap for SHIFT.

Read https://github.com/Julow/Unexpected-Keyboard/blob/master/doc/Custom-layouts.md#Modmap

I believe that CAPS LOCK performs a SHIFT on alphabetic characters only and that you can't control it separately.

@Spike-from-NH Yeah this works but what if you have multiple key with the same letter, and you want to target one specific key instead of multiple keys.

I know that we shouldn't have multiple keys with the same letter, but this is just a example or more like a question?

@Spike-from-NH
Copy link
Contributor

Should keys be nameable/addressable? I say no, because most users don't want to waste screen space by having multiple keys that do the same thing. And if you do, it's not grievous if all undergo the same transformations.

@Julow
Copy link
Owner

Julow commented Dec 14, 2024

It seems that you want an entirely different custom layout, that you'd switch to and from your main layout.

@GitAlasGo
Copy link
Author

GitAlasGo commented Dec 14, 2024

Should keys be nameable/addressable? I say no, because most users don't want to waste screen space by having multiple keys that do the same thing. And if you do, it's not grievous if all undergo the same transformations.

Having multiple keys is not a bad thing.

There are layouts, that use multiple keys, because for example:

Imagine you have the letter "a" on the left and another on the right, now both of your thumbs needs to travel less to reach the letter "a"

So you can see having multiple keys is not a bad thing, multiple layouts do this.

I would hope that i can do this without having to type the letter twice:

<?xml version="1.0" encoding="utf-8"?>

<keyboard name="QWERTY (US) Roblox chat bypass 2.0" script="latin" bottom_row="false">
  <modmap>
    <shift a="ԛ" b="Ԛ" />
    <shift a="ԝ" b="Ԝ" />
    <shift a="е" b="Е" />
    <shift a="у" b="Ү" />
    <shift a="ս" b="Ս" />
    <shift a="і" b="І" />
    <shift a="о" b="О" />
    <shift a="р" b="Р" />
    <shift a="а" b="А" />
    <shift a="ѕ" b="Ѕ" />
    <shift a="ԁ" b="ԁ" />
    <shift a="ց" b="ց" />
    <shift a="һ" b="Η" />
    <shift a="ј" b="Ј" />
    <shift a="ꙁ" b="Ꙁ" />
    <shift a="х" b="Х" />
    <shift a="с" b="С" />
    <shift a="ѵ" b="Ѵ" />
    <shift a="ո" b="Ν" />
  </modmap>
  <row>
    <key c="ԛ" ne="1" se="loc esc"/>
    <key c="ԝ" nw="~" ne="2" sw="\@"/>
    <key c="е" nw="!" ne="3" sw="\#" se="loc €"/>
    <key ne="4" sw="$"/>
    <key c="Т" ne="5" sw="%"/>
    <key shift="3" c="у" ne="6" sw="^"/>
    <key c="ս" ne="7" sw="&amp;"/>
    <key c="і" ne="8" sw="*"/>
    <key c="о" ne="9" sw="(" se=")"/>
    <key c="р" ne="0"/>
  </row>
  <row>
    <key shift="0.5" c="а" nw="loc tab" ne="`"/>
    <key c="ѕ" ne="loc §" sw="loc ß"/>
    <key c="ԁ"/>
    <key/>
    <key c="ց" ne="-" sw="_"/>
    <key shift="3" c="һ" ne="=" sw="+"/>
    <key c="ј" se="}" sw="{"/>
    <key c="К" sw="[" se="]"/>
    <key ne="|" sw="\\"/>
  </row>
  <row>
    <key width="1.5" c="shift" ne="loc capslock"/>
    <key c="ꙁ"/>
    <key c="х" ne="loc †"/>
    <key c="с" ne="&lt;" sw="."/>
    <key c="ѵ" ne="&gt;" sw=","/>
    <key shift="3" c="В" ne="\?" sw="/"/>
    <key c="ո" ne=":" sw=";"/>
    <key c="М" ne="&quot;" sw="'"/>
    <key width="1.5" c="backspace" ne="delete"/>
  </row>
  <row height="0.95">
    <key width="1.7" key0="ctrl" key1="loc switch_greekmath" key2="loc meta" key3="loc switch_clipboard" key4="switch_numeric"/>
    <key width="1.1" key0="fn" key1="loc alt" key2="loc change_method" key3="switch_emoji" key4="config"/>
    <key width="2.7" key0="space" key7="switch_forward" key8="switch_backward" key5="cursor_left" key6="cursor_right" slider="true"/>
    <key shift="2" width="2.7" key0="space" key7="switch_forward" key8="switch_backward" key5="cursor_left" key6="cursor_right" slider="true"/>
    <key width="1.1" key0="loc compose" key7="up" key6="right" key5="left" key8="down" key1="loc home" key2="loc page_up" key3="loc end" key4="loc page_down"/>
    <key width="1.7" key0="enter" key1="loc voice_typing" key2="action"/>
  </row>
</keyboard>

The letters are not english, they are Russian cyrillic letters, that look very close to the latin letters, some server in roblox that i use are banning english speakers because it's not made for english speaking countries, and while they detect latin, they don't detect some of the Russian cyrillic letters that look very close to latin.

This xml that i showed you, is a mess unreadable and we want a easier way to do this without having to type the letter twice.

You are making us type the letter in the <keys> and the <shift> when it can be shorted to just the <keys>

We should be able to define it within without having to define the same letter again.

@Spike-from-NH @Julow I would like to hear you guys option on this.

@GitAlasGo GitAlasGo reopened this Dec 14, 2024
@Spike-from-NH
Copy link
Contributor

@GitAlasGo, I agree that it would be cleaner to have a complete description of a key's behavior in a single place (inside the <key> tag), rather than defining the key then using a modmap to list exceptions. @Julow has rebutted that the status quo tracks the internal data structures better.

@Julow
Copy link
Owner

Julow commented Dec 17, 2024

The separate <modmap> is what fits the best the keyboard's code and I don't want several ways to do the same thing. This is a light app.
One example is what if you have the letter "a" on the keyboard twice but you don't have the same shift mapping for both ? I don't want the code that handles this to exists at all.

Your issue seems to be more that the XML format is heavy to write. Indeed, your <modmap> element is 550 characters long but only 38 of which are useful data. That's unfortunate but changing that would affect the app's size.

The shift modmap in your layout seems reasonable and should be added to the default shift mappings if they don't already work. Except for уҮ, which should be уУ and һΗ and ոΝ, which are nonsense.

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