nick-shmyrev / improved-osk-gnome-ext

Improved On Screen Keyboard for Gnome Shell
https://extensions.gnome.org/extension/4413/improved-osk/
94 stars 30 forks source link

[Feature request] Open/Close osk using statusbar button #25

Closed Txori closed 1 year ago

Txori commented 2 years ago

First thing first, thanks for keeping this great extension alive and improving it. In terms of user experience, it would be very nice to be able to open and close the keyboard by pressing the same statusbar icon button. Actually, it can only open the osk and I had to search a bit how to close it afterwards. The closing button can still stay where it is on the osk.

LaKing commented 2 years ago

I have a tablet that has a couple of physical keyboard keys. There are applications that are not gnome-based, and not aware of input-filed click events. Therefore, I'd like to have a a keyboard key to show the on screen keyboard. We can assign custom commands to keyboards, ...

What would be the shell script / command to show and to hide the on screen keyboard? Could you put that piece of information into the readme here on github?

Thank you very much.

RichardJActon commented 1 year ago

Thanks for improved OSK, makes my 2in1 actually usable! Switching the statusbar icon from open only to toggle showing the OSK would be a much more intuitive experience in my opinion. I've found myself tapping it to try and get it to hide again quite a bit before remembering to close it with the usual double down arrow hide icon on the keyboard itself.

RichardJActon commented 1 year ago

Hmm if I'm reading the code correctly toggling does appear to be the intended behavior:

https://github.com/nick-shmyrev/improved-osk-gnome-ext/blob/63b5629ad08cf7d5d3008aa75c376730b87ba716/extension.js#L40-L44

However if I comment out the if statement and just keep return Main.keyboard.close(); on line 41 then the icon works to close the keyboard once it's automatically been opened by clicking in a text field. Therefore it would appear that Main.keyboard._keyboardVisible is not reflecting the open state of the keyboard, rather than Main.keyboard.close() failing to actually close the keyboard. I'm not a JS dev nor have I worked with Gnome extensions before so I'm sure what to try next to debug this.

RichardJActon commented 1 year ago

Awesome Thanks for the fix!