[feat, UX] Pick keyboard layout from keyboard#5583
Conversation
Mhhh, that won't do just like that, or you have to fix all the keyboards :)
I think english/ascii should be accessible directly from a toggle layout key in all languages, because that's just practical (filenames, ...) |
@yparitcher Indeed, it's not the fault of any other keyboard that the Hebrew keyboard was written one way or the other! There is no bug here whatsoever. If you want the Hebrew keyboard fixed, fix it. Other keyboards should not be broken and nothing should be shifted. If I recall correctly you said you wrote it this way because it was most convenient for you, switching between English and Hebrew. That's fine, but if that's considered a bug it's exclusively a bug that you purposefully put into that specific keyboard.
@poire-z That's not really your or my business to decide but depends on the sensibilities and traditions of the keyboards in question. ;-) The whole point here is to make it unproblematic to quickly switch between layouts. The most sensible way is to select up to four or five desired layouts that you can easily toggle between. Also see #5414 (comment) Why five? Because then you can map 'em to swipes on the globe key. ;-) Plus you get a popup along these lines: |
Except keyboard traditions never had 12 layouts like we do :) So we can be creative and build up future traditions :) |
|
I'd prefer to reduce it to 6 (?) tbh, getting rid of the globe layer entirely. It can simply be refactored into a separate Cyrillic keyboard. Unfortunately I'm not fully up to snuff on Cyrillic, but at least unlike Arabic I can read most of the characters. :-P |
|
I guess I'd be ok with 6 (all these with some popups where appropriate):
And ideally, the activated Shift SymÄéß should be highlighted, so we know where we're at :) so we can quicky unactivate them to get back to the first layout (I sometimes spend too much time on getting back to the first one:) (Pinging @WaseemAlkurdi who's on the arabic keyboard in #5569.) |
Definitely how I'd do it. Most already work that way regardless. I think Hebrew and the current Arabic PR are the exception rather than the norm. And Cyrillic is an exception too, of course.
Not necessarily 100 % the same, but it should be pretty close for the most part. I can definitely imagine punctuation being laid out differently (like
Some layouts (like Chinese and/or Korean) got rid of that button btw. |
|
the point of this PR is to decouple keyboard language from keyboard layout.
sorry i was refering to the hebrew and arabic, but as you guys said for french and english the Cyrillic chraracters should be moved into thier own keyboard. the goal is each keyboard should have one language, however the file needs to be fixed
this is the point however Globe > is not switching to a layout rather to a different language. this is necessary in order to scale keyboard languages
this is a good idea to implement, however it would require new menu setting to select which are enabled, also to ensure that the current is enabled. and would require reworking the whole lang to keyboard table to track what the current layout is. |
For terminological purposes I think a term like "keyboard language" should be torpedoed in the bow before it can sail on. ;-) A full-on Dutch keyboard would refer either to the Dutch QWERTY layout (effectively replaced by US QWERTY since the 2000s) or Dutch/Belgian AZERTY (still a thing). There may also have been Dutch QWERTZ, or in any case QWERTZ typewriters were around in the Netherlands. The tl;dr is that there are at least three distinct keyboard layouts associated with the Dutch language, probably four. English has at least two (US & UK). More for Dutch and English alike if you also count ANSI vs ISO. (I can't stand ISO.) The fact that the current two main keyboards for Dutch are currently referred to as "English" and "Français" in the KOReader interface is mildly unfortunate. KDE presents it like this, but Windows and Mac are very similar: A "locale" is a set of properties typically associated with a physical locale. Netherlands = € 1.000,00 with a US English International keyboard layout. A keyboard layout can be part of a locale, but to refer to a keyboard layout as a keyboard locale is just confusing at best because it implies all that other baggage. The code currently says something like One layout has multiple layers, also known as levels. The base layer, the shift layer, and various other layers. In KOReader it's called the symbol layer, on a physical keyboard the Alt Gr. layer or the third layer (Shift being the second layer and Shift+Alt Gr. the fourth layer). With all that out of the way, I don't really know what you mean by decoupling the keyboard language from its layout. I decoupled the UI language from the keyboard layout somewhat recently (Device → Keyboard layout), and the way I see this PR is just to make that slightly easier to put into effect, i.e., without closing the keyboard and going into a menu. The code so far is fully in line with that. |
|
Now that that is out of the way,
|
You could get both :) by starting with the existing keyboard popup widget (re-using/extending/duplicating it), and you may quickly get something like that: Then, may be instead of having a grid of squares, just have stacked rectangles with the full language name. (The above screenshot was just a fake by modifying _z_ = {
"en",
north = "he",
northeast = "ar",
northwest = "ko",
east = "fr",
west = "zh",
}, |
|
The current menu could activate multiple layouts easily with only a minor adjustment. I'd start with that and the actual layout toggling (by tapping the globe key). The swipe/popup thing is more of a later refinement/addition, where instead of having to tap two or three times you can just swipe in a particular direction. |
Required for <koreader#5583>.
|
@yparitcher Alright, with 2019.11 out the door I can now focus on this. #5588 implements the relevant popup functionality. |
thanks, but i don't think that is going to be enough, as that allows for a callback but does not yet allow dynamically assigning the key label this also has to be customizeable koreader/frontend/ui/widget/virtualkeyboard.lua Lines 401 to 408 in 2855fdf unless i am understanding this wrong |
|
I can probably add that tomorrow, but I don't think it's related to the few lines you quoted. I'd add a Alternatively it could be made slightly more complex with something like a label_func, in which case a simple What exactly are you envisioning? Text next to the globe? Instead of the globe? |
|
the popup keys have to be dynamically assigned to a language so the label on them matches to the language set and to the enabled languages. also the globe should probably change to the current layout once the popup appears. |
|
@Frenzie: Hmm, U+21E7 looks thicker in FreeSerif (at least in FF), but it's common enough that something higher in the list might be covering it... While I'm here:
|
there are no conflicts so this is the simplest way
|
Alright, I'll give it a look later. 👍 |
|
When no layouts are enabled: |
Frenzie
left a comment
There was a problem hiding this comment.
lgtm, besides that one tiny issue
|
Thanks for putting in the effort! 👍 |
Follow-up to koreader#5583.
Follow-up to #5583. * Add separate Cyrillic/Russian keyboard * And remove that from English * Update French keyboard (is easy) * Remove yahzhert, that was just a double of QWERTY * Update Spanish keyboard * Reduce Japanese to 4 layers and add globe * Reduce Korean to 4 layers * Reduce Greek to 8 layers
* Tap goes to next activated keyboard. * Hold opens a selection popup.
Follow-up to koreader#5583. * Add separate Cyrillic/Russian keyboard * And remove that from English * Update French keyboard (is easy) * Remove yahzhert, that was just a double of QWERTY * Update Spanish keyboard * Reduce Japanese to 4 layers and add globe * Reduce Korean to 4 layers * Reduce Greek to 8 layers






this is a first draft for fixing keyboard locale support
see #5569 (comment)
the idea is that when pressing the globe icon a popup comes up to chose an input language (the same choices that are in the
keyboard layoutmenu)i made some of the necessary changes.
things i need help with:
making a popup (similar to the openwith dialog) to chose the language when pressing the globe key.
i put in comments the radio table needed for the languages options but i have no clue how the widget/input ui works to be able to make a proper dialog out of it.
fixing all the keyboards:
Äéßfrom position 9-12 to 5-8