#commad? to hide the keyboard?

Asked by David Sorkovsky on 2012-02-11

Is there a #command to put on a buttn on te keyboard so as to hide it?

Using Ubuntu Server (Natty) with X & Awesome

Question information

Language:
English Edit question
Status:
Solved
For:
Onboard Edit question
Assignee:
No assignee Edit question
Solved by:
David Sorkovsky
Solved:
2012-02-18
Last query:
2012-02-18
Last reply:
2012-02-11

This question was reopened

Francesco Fumanti (frafu) said : #1

If you install the update of Onboard that is available in our stable PPA for Natty, you will have the possibility to have a button on the on-screen keyboard to hide it. In fact, if you disable the window decoration in the Preferences of Onboard, a hide button will appear near to the upper right corner of the window on the layouts shipping with Onboard.

https://launchpad.net/~onboard/+archive/stable

Sorry to be a pain - I added the repository but have no idea how to get the PPA to go in - I even tried the manual method as the first lines of sources.list - removed & re-install just does 0.94

How do I get it to update to 0.96.2-0ppa~natty1

Francesco Fumanti (frafu) said : #3

Typing the following in the terminal should be sufficient to add the repository to your sources. If it does not work in Natty, please write back and I will look further.

sudo add-apt-repository ppa:onboard/stable

Did that ok - But what next?

sudo apt-get update
sudo apt-get upgrade

no change :-(

By the way - I'm running on ARM - would that be the issue?

Francesco Fumanti (frafu) said : #5

I don't know whether it is a problem because you are using an ARM architecture. It might well be because Onboard 0.96 contains an extension written in C and the PPA builds binaries only for the i386 and the amd64 architectures. I don't know whether ARM is compatible with one of these architectures.

Do you have any experience compiling packages by yourself?

Not really - I tried to download the source, added the tools, but I have not been successful

I tried downloading the code + tools, etc and now I can't use onboard on my desktop :-(

/usr/lib/python2.7/dist-packages/gi/module.py:138: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  g_type = info.get_g_type()
/usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: g_type_get_qdata: assertion `node != NULL' failed
  type_ = g_type.pytype
Traceback (most recent call last):
  File "/usr/bin/onboard", line 14, in <module>
    from Onboard.OnboardGtk import OnboardGtk as Onboard
  File "/usr/local/lib/python2.7/dist-packages/Onboard/OnboardGtk.py", line 17, in <module>
    from gi.repository import GObject, Gdk, Gtk
  File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 76, in load_module
    dynamic_module._load()
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 249, in _load
    overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
  File "/usr/lib/python2.7/dist-packages/gi/overrides/Gdk.py", line 240, in <module>
    class Cursor(Gdk.Cursor):
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 163, in __getattr__
    raise TypeError("unable to create a wrapper for %s.%s" % (info.get_namespace(), info.get_name()))
TypeError: unable to create a wrapper for Gdk.Cursor

So, it doesn't look like I'm able to compile packages by myself

Francesco Fumanti (frafu) said : #8

I asked the an Onboard coder to have a quick look at it and he wondered whether you have installed all the dependencies. You can see the dependencies of Onboard 0.96.2 in this file:
http://bazaar.launchpad.net/~onboard/onboard/0.96/view/head:/debian/control

You should also check whether the following statement fails:
python -c "from gi.repository import GObject, Gdk, Gtk"

Progress of sorts...

Built & Installed and now I get ...

"onboard" gives:

2012-02-14 19:40:57,493:ERROR:Config: gsettings schema for 'apps.onboard.window' is not installed

"./onboard" runs ;-)

All I need to do is get the "floating" piece to remain visible and "toggle" the keyboard and I'm happy - time to start playing with the code ;-) Then I'll have to try and make it on the ARM!

BTW: I get this at the end of the build and again at the end of the install...

WARNING: the following files are not recognized by DistUtilsExtra.auto:
  PKG-INFO

Francesco Fumanti (frafu) said : #11

I am Glad to see that you progressed.

To compile the schemas, you can use the following command:
sudo glib-compile-schemas /usr/share/glib-2.0/schemas

I took it from message 1 of this thread:
https://answers.launchpad.net/onboard/+question/186072

I think that you can ignore the warning from DistUtilsExtra.auto about PKG-INFO.

Got the code sorted to keep the IconPalette open and changed to a toggle...

KbdWindow.py:
  Add: self.icp.connect_object("deactivated", gtk.Window.iconify, self)
  After: self.icp.connect_object("activated", gtk.Window.deiconify, self)

IconPalette.py:
  Add: _keyboard = True
  After: _button1_pressed = False

  Add: gobject.signal_new("deactivated", IconPalette, gobject.SIGNAL_RUN_LAST,
                  gobject.TYPE_BOOLEAN, ())
  After: gobject.signal_new("activated", IconPalette, gobject.SIGNAL_RUN_LAST,
                  gobject.TYPE_BOOLEAN, ())

  Change: self.do_hide()
              self.emit("activated")
  To: if self._keyboard:
      self.emit("activated")
              else:
      self.emit("deactivated")

  Change: self.show_all()
  To: self._keyboard = True
        self.show_all()

  Change: self.hide_all()
  To: self._keyboard = False
        #self.hide_all()

That's it! IconPalette now alternates between triggering a new "deactivated" event and the existing "activated" event. I think this will serve my needs, but for anyone else - it probably should have an option added to allow the user to choose to keep the Palette or not.

Next step I have no idea about - building a package I can use on the ARM - ideas?

Francesco Fumanti (frafu) said : #13

What about starting the onboard-settings dialog? ;-)
(Onboard has more than one layer of keys. There are buttons along the right edge to switch layer and there is a button to open the Preferences dialog aka onboard-settings on the scond or third layer depending on the layout of Onboard used.)

I don't know whether ARM needs special treatment, but here is a link that might help you get started building debian packages:
https://wiki.ubuntu.com/PackagingGuide

Yes, the option would be done in the preferences [I've actually done that now just to learn a bit more about gtk & python - might tidy the operation a bit and this I'll let you know the changes - not bad for a first attempt at both even if I do say so myself!]

Thanks again - I'll look into the packaging next ;-)

BTW - I did all my changes on 0.94 as that is the atty build I had working - not sure what the changes were in 0.96 but if they stop the support of ARM, you may want to revisit them.

Got it all working as I needed basically just copied all the files to the ARM - there we no changes that required different libraries, just logic as I showed above, all good now!

Thanks for your help - Hope the code I pasted helps others - I have additional changes to make the "stay displayed" an option + modified settings & layout as well - if anyone wants them, drop me a message.