Code Monkey home page Code Monkey logo

Comments (11)

Julow avatar Julow commented on July 30, 2024 1

The accents presented on the keyboard aren't related to Unicode. All the "accented" letters in the languages supported by the keyboard are also a single Unicode characters, the accents on the keyboard are just a way to avoid having so much characters on it.

Currently, languages and layouts are separated in the keyboard. All the currently supported languages (french, spanish, italian, swedish) can be used on any of the two layouts (AZERTY, QWERTY).
To keep this separation, it would be great to have the character on every layouts. I see two solutions: place it on the keyboard but hide it when the German language isn't installed (that's how accents work) or add a combination (for example ◌̈ then s).

Is the German umlaut the same as the French trema in Unicode (Diaeresis) ? Which would be handy because it is already implemented on the keyboard.

but I'll probably need a screenshot of the result

Happy to help.

from unexpected-keyboard.

Julow avatar Julow commented on July 30, 2024

Hi! I'd be happy to accept contributions !

You are right about the xml file. You also need to add some plumbing: here and here then here.
The accents option specifies which accents are needed for each languages. Do you think you can use trema for your language ? It is implemented with KeyCharacterMap.getDeadChar. If that's not enough, it is fine to add new cases or a new accent type.

The development environment is the hardest part. I suggest you to use the shell.nix present in the repo (warning, the closure is big).
Otherwise, there's not many requirements: openjdk8, the Android SDK.
In the SDK, you need: build tools 30.0.3, platform 29.

from unexpected-keyboard.

Moini avatar Moini commented on July 30, 2024

Hi @Julow - thanks for the welcome!

German Umlauts are not accented letters, but letters of their own (in Unicode terms, 'precomposed' vs. 'decomposed'), so they would need their own little icon, commonly (as keyboard size is restricted / or even fixed?) on the letter that looks similar, so it would be letter a in the center, and ä and ´ and ` in three of those corners, same for o/ö, u/ü and s/ß.

I'd like to try just editing the xml files without setting up an Android development environment - will check the xml for validity, but I'll probably need a screenshot of the result to know whether it looks correct. Would you help me with that, when I think it's ready?

from unexpected-keyboard.

Moini avatar Moini commented on July 30, 2024

A umlaut is U+00C4 (capital) and U+00E4 (lowercase). It's not an accented letter, but a separate entity, unfortunately.

As long as that is what is returned by the app, it would be okay.

It's very uncommon (and it looks like it can confuse parsers, at least) to represent the letter as a sequence of two (or even three) code points:

U+0041 latin small letter A
U+0308 combining diaeresis

If the app returns the 'Ä' and not the combo, it's all fine. Did I understand you correctly that that's the case?

(Note: German needs QWERTZ, not QWERTY)

On a real German keyboard, we'd have äöü as separate keys and ß on the question mark key (so the question mark is uppercase; there's no uppercase ß in use).

Usually, as space is scarce on phone keyboards, äöü are placed on the respective aou (it would be peculiar, but not 'horrible' to have them only represented as two dots). The ß is placed on the s key. It would be very unexpected (pun intended) to have two dots represent an ß - those are only for vowels, not for consonants.

from unexpected-keyboard.

Moini avatar Moini commented on July 30, 2024

Oh, I get it now, äöü would require two swipes with your method... :/

The thing is, I found this keyboard and thought it's super useful to get my letters typed out faster, because I only need to swipe once to get what I need. But that combining action with two swipes would not make it faster, but slower, because I still would have to search for both parts.

Edit: as an explanation: äöü and ß are frequent letters, not comparatively rare things like the trema in French. Less frequent than é, though, I think.

I'll provide a keymap that would do what seems useful to me, but it might be that you won't want to accept it.

Just a thought: maybe you could make your app be universal, if instead you allowed users to select their own keymaps?

from unexpected-keyboard.

Julow avatar Julow commented on July 30, 2024

That's right, the accents on the keyboard aren't related to "accented letters" in Unicode, the keyboard will output the right characters but the users as to type the accent first then the accented letter. It won't use Unicode combining character but will use an internal lookup table to find the expected character.

But also, accents are not correlated to layouts (qwerty, qwertz): every accents must be on every layouts (of course, they are not shown to users that don't use the corresponding languages).
This is also why the ß character need to be available on every layouts (as I said before, either it can be a character on its own that is hidden for non-german users, or it can be accessed with a combining key).

I confirm that the "trema" accent currently on the keyboard outputs the characters you expect (I might have to rename it internally to make that clearer).

Just a thought: maybe you could make your app be universal, if instead you allowed users to select their own keymaps?

The description of the keyboard can't be universal either. There's the keyboard layout, then there's the definition of "special" keys, the internal lookup tables for accents, some languages might need more characters than what can be shown on a single screen. All of these need to be supported in the code of the keyboard at some point.

from unexpected-keyboard.

Moini avatar Moini commented on July 30, 2024

Thank you for the response!

How does the placement of optional accents work? Are they placed more or less 'randomly'? We don't have trema or cedille, for example. I could already mark a place for them that feels right, or not.

German keyboards have ´` (edit: and ^), as combining marks by default, and if you press the key a second time, you get them solo.

Some programming languages require backticks for example, as well as the ~ and the ^ as single letters. I did find ~ and ^ on the numpad, but I couldn't find the backtick. (edit: found it now!!!) Should that be added somewhere? I find it pretty useful to have all these on the main keyboard already, tbh... which is why, in my first iteration, I've placed them all there, currently. There was enough space for all of them.

Can accents work as single chars, or can they only be combined? If I slide to use ß, I'd only want to enter a single letter, not, say, first s and then ß. That kind of defeats the purpose of the speedy keyboard.

Would this result in typing an ß as 'swipe ß' then 's'? Or would that kind of accent be able to output a full letter?

from unexpected-keyboard.

Moini avatar Moini commented on July 30, 2024

Made an MR with a start in both directions here: #20

from unexpected-keyboard.

Julow avatar Julow commented on July 30, 2024

Thanks!

All the characters programmers use must be on the keyboard (see the other layouts). The accents are placed more or less where they are the easiest to use when typing french. Moving them where they are the most useful for German on QWERTZ is a good idea.

The accents become a character on the space key. The "^" and "`" accents + space become the ^ and ` ascii characters but the other accents become some non-ascii characters.

There's no ß accent at the moment. My two suggestions above were:

  • Have a ß character on the keyboard
  • Add a specific combination of an existing accent (for example ¨ then s or Fn then s)

from unexpected-keyboard.

Moini avatar Moini commented on July 30, 2024

Ah, okay, so I would like to make the ß a normal char and remove the accent part again, and would need to remove the duplicate items from the list. I didn't expect space to work like that, should be documented! I'll update the MR on the weekend.

from unexpected-keyboard.

Julow avatar Julow commented on July 30, 2024

Thanks a lot for your contribution !

Please re-open if you want to change the layout again :)

from unexpected-keyboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.