Add show virtual keyboard button#15051
Conversation
…button on hasKeyboard
|
(Please try to not miss answering any of my questions :) you often do when I ask many :)) From what I can gather from your screenshot and a quick glance at the code, you are fixing the issue that with I initially felt it a bit odd that any mediumly heavy UI stuff would happen in InputText itself (low level widget), felt it would rather be InputDialog (upper level). My main issue with the current state is with the fullscreen InputDialog (ie. Book style tweak editing), which already has a button to popup the VK (which reduces the InputText height when the VK shows up):
So, I hope these last points are on your roadmap :) |
Commodore64user
left a comment
There was a problem hiding this comment.
looks nice, #KeyboardWarriors, shouldn't the default change to virtual keyboard being disabled?
| if Device:hasKeyboard() and request_source ~= "frame_keyboard_button" then | ||
| return false | ||
| end |
There was a problem hiding this comment.
this cripples shift + home though
There was a problem hiding this comment.
Emphasis on poc/draft and unfinished. Comments welcome of course, but there's no need to do an in-depth review unless you want to.
| return false | ||
| end | ||
| if not self.focused then | ||
| -- FocusManager updates selected *before* sending the Unfocus event, |
There was a problem hiding this comment.
feels like there is a word missing here
this is not true though, shift+home has always been an option |
|
I still don't believe @poire-z has a valid reason to request having vk on be treated differently. I also don't understand how you have gone from, it annoys me to have a vk to, I don't want to live without it, alas that is irrelevant. the facts are, vk is always ready on demand via shift+home. isTouch should not get preferential treatment simply because one feels is nicer not to have to deal with one's own choices (having it there). The main problem has been solved, all of @NiLuJe's concerns were addressed even if
you know this was the reason for all those problems, and I am happy you realise
that this was the right approach ;). |
No, the issue I'm fixing is that the virtual keyboard annoyingly pops up constantly while merely navigating around, whether by keyboard or gamepad, unless you disable the virtual keyboard completely. For the end result the distinction might not matter.
Whether it conflicts or not is merely a matter of what we tell it to do, but I'm not sure what you mean by conflicts exactly. Afaik it simply works everywhere but of course I haven't tested every individual textbox while it's still in the poc phase. There may be some focus-related events in some widgets that need some minor adjustments. For highlight note editing that currently means it looks like this:
You're pretty much just describing this PR? Please just try it to see the behavior, otherwise I'd have merely posted a recording. ;-) |
The fact that we lose focus when reaching the top or bottom lines to get to the buttons above or below, it is odd as hell, I've never seen that (ie. in this here web browser textarea box). It may be the only solution on non-touch devices, but it shouldn't be there when they are other ways to get to them.
Great, so you solved your main problem. |
|
and I'd like to stress one more thing, whether isTouch or not, the thing needs to be fully functional just with keys... mouse input going mad is a real thing #15019, koreader/koreader-base#2154
I'm sorry, it needed to be keys that all supported devices had, blame the k4
most places use Tab to move that kind of focus. |
In that case I misunderstood. I'm not sure if I want to change that in this PR though.
Yup, that's exactly what this PR is about. I don't find it to be entirely usable on master right now with just keys, and with this PR I do. |
Well, then we'll fix mouse input. No need to throw as most users without mouse problem that when he reaches first line with arrow keys, he needs to lose focus because users with mouse problem might need a way out :)
And it's just fine it being available, but if a most obvious way works the better. |
Conceptually I see two primary viable approaches (yes, I'm ignoring Shift+Home):
|
Well, you indeed got that I'm annoyed by the focus navigation getting in the way of cursor moving :) |
It will require some architectural changes for gamepads, but that's not urgent. When you're using a gamepad you don't always want to grab a keyboard even though you can. SDL is currently always defined as hasKeyboard, which is usually true, but SDL can also be used to run on devices that technically don't have one (i.e., Linux phones/tablets.)
That should be fairly easy to adjust and it would align with how those already work elsewhere. I'll close this draft and I'll start a new branch based on this one to do the adjustments, because I really enjoy how well it currently works with a gamepad, but getting regular keyboard behavior right has higher priority. |
|
@poire-z But while tab doesn't make much sense in a single-line TextInput, what about the multiline one? Currently it seems to insert a tab (or is it 4 spaces). Maybe multiline would need the enter/exit logic regardless, since the other logic I wrote here doesn't work on it very well. |
It might matter in multiline inputtext. Maybe not in a "Add note" one (although I don't know, people may like it), but in Text Editor or Book style tweak, one may want to use Tab for text indent.
I'm not sure I get what you mean by "enter/exit logic" (you already mentionned that above), is it different from the current focus/unfocus ? |
|
It means focus on the field doesn't automatically enter editing mode. @Commodore64user had implemented something like that in an earlier version. For simple text input that's an inconvenience that can be avoided, but if things like tab are overloaded it's unavoidable for multiline. |
|
Also I'd like to point out that the tab user experience is significantly worse than the FocusManager user experience. |
|
The spatial navigation standard is shift+arrow keys. I'll implement both. |
So, once focused, you'd need to press Enter to be able to use the keyboard ? Feels odd :) |
that is not quite the point though. You should always be able to control everything without needing to reach for the mouse. I actually quite like the up/down behaviour @Frenzie came up with, even if it slightly feels punishing, one is always one key press away from returning to the input box. I am not entirely sure what exactly @poire-z expects from having a virtual keyboard up? and no, disabling all events is not the answer... |
I don't see how else you intend to use tabs both for text input and for navigation. You need a mode switch for that.
Yes, that automatic popup is the problem, or the immediate focus on the virtual keyboard to be precise. It makes the program very hard to use, and I don't find disabling the virtual keyboard satisfactory. It needs to be both out of the way and easily and intuitively accessible. This PR provides a solution to that problem that I think works rather well with both keyboard and gamepad. The primary alternative to me is to change nothing except to assign Left and/or Right Trigger to the same action as Shift+Home. It's much less intuitive but otherwise about the same.
I'm not sure if that necessarily follows, but either way that's a far cry from interfering with basic navigation. |
Being able to access other keys/layouts that are not available on your physical keyboard (arabic, chinese, all the symbols and punctuations we get on long-press on the digit keys), which might be useful in notes: It's not that I personally often need it, it's just that it is/was there, sacrificying its availability on the altar of NT usability it a bit much.
I'd say that when you are in a InputText, arrow keys should just move the cursor. You could use Esc to... escape that InputText prison :) - hitting you head/cursor against the walls and magically getting out is nice, but a bit too SciFi :) |
I'm not insisting on the Tab idea, I was just saying it's what usually used everywhere (even in this textbox, and it is annoying :)). |
this, in my opinion is your problem right here. You see this as a non-touch thing, when in reality, all of this has nothing to do with NT and all to do with I do like @Frenzie's idea because it requires less effort from the user, you don't have to remember shift+home.. but I feel @poire-z keeps coming up with obstacles that can be reworded simply as, but I don't like the change... |
Indeed. While Kindle NT does have some unique properties, nearly all improvements to d-pad/arrow keys + enter apply to any device that has those available. Which even includes touchscreen Kobos if you hook up a gamepad or keyboard over BT or USB OTG. |
Well, I use "NT usability" because I hope these latest changes are at least an improvement in that context - which I have no experience with. So, I rephrase: sacrificying VK availability (and arrow keys in-text navigation) on the altar of focus navigation is a bit too much. But may be you're both too focused on the navigation between small input texts (which I happen to rarely meet) and I'm too concerned with the fullscreen editors (where the changes do feel like a regression in usability). |
If Enter is just to get the VK after focus - but if once you get focus we can start typing with the physical keyboard, I guess I'm fine with that.
I have tried to explain why I don't like the changes. Mostly to give you some food for thoughts. You're probably be on a diet. |
This poc isn't about those. I haven't paid attention to them because otherwise it wouldn't be a poc. ;-) |
"but I don't like it" strikes again... having a vk there wasn't a feature, it's wrong. Name any other software where people need to have both a virtual keyboard and physical keyboard in order to function properly |
I don't feel like it, continuing discussing that with you, if that's what I shall get. |
|
but explain to me, how is it exactly a regression to remove something that took half the screen for no real reason? but remember the argument that odd symbols were much easily accessible won't cut it because that was just wrong to begin with, no other programme requires a vk to function properly, you know that. |
|
for what is worth, I just checked how kindle 3 handles cursor/focus when adding notes (which is the only large-ish text box I could find) and it does the same, arrow keys move the cursor around until you reach the last line where it jumps focus to the button row. it doesn't loop around but then again that is consistent with their whole system wide no loops. can you @poire-z name an example of how this disrupts your adding of tweaks? like at worse you'd be a key press away from getting back to the text input box |
|
And that's probably perfectly fine on Kindle, as there are probably no other easy way to get out of the text box. |
That's not entirely true. Spreadsheets for example behave exactly like that, and that's one of the reasons people (ab)use spreadsheets as databases. They're just much simpler to use than awkward tab/shift+tab.
For the near future I'll interpret that as the general approach is fine, but it might need some tweaks for multiline usage. While I don't quite agree with the above, the simple fact is that [in a multiline textinput] it's too difficult to reach the previous/next input and that requires a solution. |







@poire-z It's not entirely finished, but sufficiently so that you can say if you like the idea.
Peek.2026-02-28.18-52.mp4
This change is