GNOME Bugzilla – Bug 567880
Changing keyboard layout should trigger visual feedback
Last modified: 2010-06-05 15:22:03 UTC
First of all, I'm really sorry if this is completely the wrong section. I got a bit lost... At the moment, it is easy for an end user to accidentally change the keyboard input language, resulting in confusion. To this end, Windows has a similar issue for example. In Canada, computer manufacturers ship Windows preconfigured with a Canadian Multilingual and French "input language" installed. They often neglect to enable the language bar (similar functionality to our Keyboard Indicator applet). The shortcut to change input language is one that a user could concievably press by accident. (Alt Shift, I believe). Users always do this within minutes of getting their computers and become confused. This has been to blame for wrongly typed passwords on more than one occasion. In GNOME, the issue is precisely the same. Keyboard layout can be changed via a shortcut, the panel applet for this is not always visible, and when it is not (even when it is) there is absolutely no visual feedback. This functionality needs to more readily expose itself to the user. When the user switches input language, I propose that a notification bubble be displayed for a short time explaining that the keyboard layout has been changed to X, and the mentioning necessary keyboard shortcut to change it back. It should not necessitate any kind of user input (with action buttons) and should close automatically, since the user probably wants to start typing! Ideally, some further enhancements could be done. For example, perhaps the keyboard indicator applet could glow for a moment when the keyboard layout is changed via the keyboard shortcut. Adding that applet to the panel when the default configuration doesn't have it could cause the keyboard layout notification bubbles to be muted, since the addition of that applet to the panel is a confirmation by the user that he knows the feature exists.
Created attachment 130679 [details] [review] Displays a simple notification bubble whenever the keyboard layout changes This patch, based on gnome-settings-daemon trunk in SVN, creates a notification bubble whenever the keyboard layout / group is changed (be it from focusing a window with a different group set, or a global change). The bubble says simply that the layout has been changed and the full name of the group it has been changed to. As it is, I think this is a valid and stable fix, although there are some things that could do with solving. * It would be cool if the notification bubble mentioned the keyboard shortcut to change layout to spare the user any guessing. (The shortcut could be anything, so it has to be determined automatically). * Right now a user who loves switching between keyboard layouts every five seconds (is there such a person?) could be driven to insanity by these notifications. Further, clicking on the keyboard indicator applet to change layout also causes a notification bubble to appear. Someone who understands Bonobo could probably get that one fixed. As mentioned previously, the notifications should only display in the absense of the keyboard indicator applet. * Some may cringe at how I have added libnotify stuff and an x keyboard state change callback to the keyboard plugin when none of it was there before. I get the feeling this is a happier solution than having another daemon do it. One alternative is to have this all happen in gkbd's indicator applet, and have something enforce the creation of that applet (maybe in the system tray, with some added fiddling) whenever more than one keyboard layout group is set. Have fun :)
Dylan, beautiful patch. I was just wondering whether we need a flag for ./configure to enable libnotify detection but it's already there. Maintainers, could you please make yourself heard if you don't want patch 130679 to be committed?! Thanks :)
I am in doubts really, lads... For people who change layouts unfrequently, that is a nice thing to have. But when you type, say, technical text in Russian with lot of English words (terms, brands) - that feature might become annoying. Another thing - if user has 'layout per window' mode, pressing 'alt-tab' will in some cases have side effect - that bubble. IMHO this is slightly odd. What do you think?
A few points: * I doubt that the majority of users change keyboards frequently * I consider it very informative to know when I accidentally switched layouts * It would be very nice to turn it off though, i.e. at least a GConf option
> I doubt that the majority of users change keyboards frequently It depends very much on the group under test. For example, Russians are changing the layout quite frequently. And I suspect other nations with non-latin alphabets have similar statistics - and they are usually the very people who use multiple layouts, right? Actually, if it is not too hard, would you mind making the screenshot of the bubble? I would put it on Russian slashdot and ask people what they think? I would even organize voting. I know, there is always specific bias on those sites, but it is still some kind of vox populi... > I consider it very informative to know when I accidentally switched layouts Yes indeed. But there is already indicator for that purpose;) > It would be very nice to turn it off though, i.e. at least a GConf option The question is what would be the reasonable default. What if it is disabled by default (like usage of flags:)?
Currently the standard for showing feedback for keyboard shortcuts (like volume changes, brightness changes, eject, etc) is to use a OSD window. If we want feedback for this it should probably use the same. What is the keyboard shortcut for changing your layout or input method by the way? The shortcut should only switch between methods that have been previously added to a selection list of some kind. And I think that for GNOME 3 we want to show a status indicator in the top menu bar when the user has such a short list enabled. Some notes about that here: http://live.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/InputLanguage (iirc - the wiki is down right now)
William, there is no single shortcut for switching between layouts (technically speaking, XKB groups). There is a number of options in the Keyboard capplet, Layout tab, Layout Options popup. Yes, it switches between layouts in the selection list. In GNOME 2.30 the indicator is in the notification area. I moved it there because it is the only way to provide indication that would be compatible with both gnome 2.30 and gnome3. You will see it it you add 2nd layout in the keyboard capplet. Thanks for the screenshot - but it is not the screenshot of the notification bubble. It is just a popup layout selection menu which already exists.
Created attachment 159115 [details] [review] Displays a simple notification bubble whenever the keyboard layout changes I uploaded two screenshots at http://people.ubuntu.com/~dylanmccall/screenshots/layout-change-notify/. One is with the standard notification-daemon, the other is with Ubuntu's notify-osd. I'm also attaching an updated patch that improves compatibility. Turns out notify-osd didn't listen to our plea for it to close the old notification, so, instead of creating a new notification each time, I used notify_notification_update. That's probably a better way to do it anyway. I agree that the landscape has changed a tad now. So, this could easily be redundant by 2.32. I won't mind if it is :) Thanks for the interest!
Thanks Dylan. Looks nice (even though I do not drop my hesitation so far). Just for the record, the discussion on "Russian slashdot" is here: http://www.linux.org.ru/forum/desktop/4797450
While I am still thinking about pros and contras (and discussing with my Russian colleagues)... If we commit that code, I'd put it into libgnomekbd, into gkbd-status. Also, first thing, I'd add the gconf key to disable that feature. MUSTHAVE :)
Actually, the more I think about that feature, the more I come to the following conclusion: Yes, the code is nice and clean enough to have it in libgnomekbd. Along with gconf option. Disabled(!) by default. If some particular distro wants to have it enabled by default (and annoy users, as I said) - I cannot stop it from using tiny patch replacing 'false' with 'true' ;) This would be similar to flags - that code is also disabled by default, but people who want it, can have it.
Only one who has never changed his layout could ask for this. Please, don't make it a default option, otherwise it will be the most terrible default option in Gnome.
And one more comment: a lot of users use separate layout for each window. Will this thing raise also when you switch windows? You'll finish having a desktop full of notifications.
Thanks for the critique, Sergey and Dmitriy. You're right: I am not one who uses keyboard layouts very often, and I have since changed to just using the compose key sequences. The forum thread is really useful, too. I had to run it through Google Translate, but it's pretty obvious where the thoughts are. I agree it would make sense to limit this as a confirmation popup that appears only when the key combination is pressed, but then I'm not sure if we can do that without being invasive. On the other hand, I don't agree with adding an option disabled by default. If it's that bad, we probably just shouldn't have it. The point I'm raising here is mainly based around stupid OEMs. The problem could easily be specific to units sold in Canada, anyway, so could be more constructively resolved by telling them to pay attention to their end users. (Besides, come to think of it, it appears the layout switching key combination is disabled by default — not sure why I thought otherwise — which basically solves this since people who enable it probably know what they are doing). A tidy resolution would be the adoption of some common design for what indicators do when they change state. For example, a sound could play, and since we can now do positional desktop sounds it could be positioned at the shell's keyboard layout indicator. I'll leave this decision up to the maintainers, of course, but as the reporter I am definitely happy with the useful information from people who would actually be directly affected :)
Dylan, Thanks for being flexible and openminded! Regarding the sounds - this can also be annoying for some people. At some point the kbd indicator applet had sound plugin that did exactly what you described. I coded it, committed it, used a bit - and then turned it of (on my desktop), forever:). One of the potentially useful ideas expressed on linux.org.ru would be to be able to execute some command line (specified in gconf) on the group switch. That way ordinary people would not get too much noise (my biggest concern) - but tweakers can always have something beeping, flashing (using xgamma), popping notification bubbles, sending emails ;) etc. What do you think?
Dylan, what do you think about bug #616380 ? That looks like more appropriate application of notification bubbles...
Well, I for one disagree with the “just making it an option” approach, since this is functionality we could put in a separate daemon anyway with very little trouble, thus sparing gnome-settings-daemon some overhead. As for bug #616380, well, I dunno. A notification popup strikes me as pretty strange since there are just two states — on and off. The GUI part of Logitech's Windows driver package actually does produce a (terrible looking) on-screen display when one presses Caps Lock, though, so maybe they had some interesting reasoning…
> this is functionality we could put in a separate daemon anyway Ghm. That is very questionable. Your patch is a tiny self-contained piece of code, adding almost no fat to g-s-d (the most concerned people can always #ifdef it). Having a separate unix process just for this function would be an overkill and overengineering. If you look at the code that implements support for flags - it is much larger. But it is there because some people need it.
Ok Dylan, let it be as you wish. I will close this one as WONTFIX. Perhaps one day we'll return to this topic again...
Comment on attachment 159115 [details] [review] Displays a simple notification bubble whenever the keyboard layout changes So patch 159115 is rejected I assume..