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

[Question] Best way to handle accent ? #854

Open
barcell1 opened this issue Oct 8, 2024 · 8 comments
Open

[Question] Best way to handle accent ? #854

barcell1 opened this issue Oct 8, 2024 · 8 comments

Comments

@barcell1
Copy link

barcell1 commented Oct 8, 2024

Is using overload like the code below the best way to handle compose keys with accent ?
like [+a will become á

[ids]
*

[main]


[ = overload(agudo,[)

[agudo]
a = á
e = é
i = í
o = ó
u = ú


[agudo+shift]
a = Á
e = É
i = Í
o = Ó
u = Ú

Thanks in advance !

@barcell1 barcell1 changed the title [Question] How to make it work with flatpak apps ? [Question] Best way to handle accent ? Oct 9, 2024
@nsbgn
Copy link

nsbgn commented Oct 10, 2024

To be clear, are you asking help on making this work or are you just asking about the 'best' way?

Because there isn't one. I personally prefer manually using the compose key to make accented keys (ie compose ' e for é), but that is because I typically write in languages that use accented symbols sparingly. Do what works for you. What you showed sounds reasonable.

@barcell1
Copy link
Author

are you just asking about the 'best' way

This ! Thanks for your answer, im starting using this plugin, and my language is very common using accented keys. I just feel that the way i made here, i need to make the move kinda fast to work the combination, sometimes i miss, hence the question. But so far i found a very good tool !

Congrats for your work, is helping me a lot in the keyboard that im using, kinda hard to find decent keyboards in native language with a reasoanable price, so i use a US one and need some adaptations.

@barcell1
Copy link
Author

To be clear, are you asking help on making this work or are you just asking about the 'best' way?

Because there isn't one. I personally prefer manually using the compose key to make accented keys (ie compose ' e for é), but that is because I typically write in languages that use accented symbols sparingly. Do what works for you. What you showed sounds reasonable.

is possible to make a little longer (the overload to wait next key to see if accent will enter) in that way that i did ?

@nsbgn
Copy link

nsbgn commented Oct 13, 2024

i need to make the move kinda fast to work the combination

What do you mean? As long as you are holding [, the combination should stay active.

is possible to make a little longer (the overload to wait next key to see if accent will enter) in that way that i did ?

What is the exact behaviour you're looking for in terms of keydown/keyup events?

I would otherwise suggest to use <[ down> <a down> <[ up> <a up> for á and <[ down> <[ up> <a down> <a up> for [a.

From what you've told me, I'm assuming that you want to be able to do <[ down> <[ up> (some short time) <a down> <a up> to get á, but <[ down> <[ up> (some longer time) <a down> <a up> to get [a. Is that correct?

@barcell1
Copy link
Author

barcell1 commented Oct 14, 2024

From what you've told me, I'm assuming that you want to be able to do <[ down> <[ up> (some short time) <a down> <a up> to get á

I just want to extend a little that time, to get the á.
So would be:
<[ down> <[ up> (some little long time) <a down> <a up> to get á

@nsbgn
Copy link

nsbgn commented Oct 15, 2024

That would be covered by oneshot(agudo), but how then do you still want to get [?

@barcell1
Copy link
Author

barcell1 commented Oct 15, 2024

yes, i still need the [ , so the oneshot would not work , i could not tune the ms time to hold the overload to a little longer ?

@nsbgn
Copy link

nsbgn commented Oct 16, 2024

i could not tune the ms time to hold the overload to a little longer

Perhaps you can, but I'm struggling to answer your question because it is still unclear what you mean exactly. I would encourage you to think about all the different paths that your keypresses can take.

Taken at face value, it sounds like you want a press of [ to produce [ as normal, except when press of a (et al) occurs during or shortly after. You could achieve something like that using oneshotm like so: 1

[ids]
*

[global]
oneshot_timeout = 100

[main]
[ = oneshotm(agudo, [)

[agudo]
a = macro(backspace á)
e = macro(backspace é)
i = macro(backspace í)
o = macro(backspace ó)
u = macro(backspace ú)

[agudo+shift]
a = macro(backspace Á)
e = macro(backspace É)
i = macro(backspace Í)
o = macro(backspace Ó)
u = macro(backspace Ú)

However, I'm skeptical that that is something that would actually feel good to type, because it means that you would have to consciously pause between [ and a if you want to type [a.

You could also mean by 'extending the hold time' that holding [ down for longer should disable one half of the overload. You could do that by [ = timeout(overload(agudo, [), 200, [) or [ = timeout(overload(agudo, [), 200, layer(agudo)).

You could also put the disambiguation entirely on hold time, like [ = timeout(oneshot(agudo), 200, [). Or perhaps you meant something else entirely.

Footnotes

  1. There are some caveats, but I won't go into that until I know this is really what you're after :P

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

2 participants