[mythtv] [PATCH] Please Test - Virtual Keyboard for Line Edits...

zoiks2004-ivtv at yahoo.com zoiks2004-ivtv at yahoo.com
Mon Jun 27 05:18:23 UTC 2005

The attached diff will apply to MythTV 0.18.1 to give
the Line Edits a popup virtual keyboard.  I didn't
apply it to CVS because I've been having major
problems getting CVS to compile so I can test it, but
it should be easy to port to cvs.  So if anyone wants
to test this on CVS that would be great.

I could port it to latest CVS, but won't even be able
to test if it even compiles (though it likely does -
the affected files aren't much different from 0.18.1).
 The only two files affected are
libs/libmyth/mythwidgets{.cpp, .h}.

Anywho, this is what the virtual keyboard does:

1) Activated by hitting "Enter" (or "Select") while a
Line Edit is in focus (keyboard or remote).  (Takes
away the default hitting "Next" behavvior. - to go to
the next window in myth, just highlight "Next"
2) Provides all the important keys from the keyboard:
all printable characters, plus shift, shift-lock,
space, left arrow, right arrow, delete, and backspace,
and a "Done" key (where "Return" normally sits) for
closing the popup.  The layout follows the layout of
the keys on my laptop.
3) Goes below the currently active line edit unless
there's not enough room in the myth window.  In that
case, it appears above the line edit box.  It also
keeps itself from extending off the myth window on
either side.
4) Closes with the Escape key or by hitting "Select"
on the "Done" button.  (Doesn't work when "ESCAPE"
action is generated by a remote(lirc) - see below.)

Issues: (most important to least, in my opinion)
1) The "ESCAPE" action generated from lirc does not
close the popup.  (Though it works fine with the
keyboard Escape button).  This is because the custom
event for ESCAPE is not being sent to the Line Edit
widget if it's generated fromm a remote.  I don't know
exactly how to get around this because I'm still
unfamiliar with the event generating routines in Myth.
 I suppose I could kludge it by setting a timer when
MythLineEdit::focusOutEvent is called, and check 1
second later to see if it is still otu of focus.  In
that case, the popup can be killed explicitly.

The easiest is to simply pass the "ESCAPE" events to
the currently focused widget, which in this case is
hte MythLineEdit.

2) Needs a way to enable or disable this feature
within the Myth setups.  Might be nice to store the
value in the database so that it is remembered after

3) The mouse poinyer appears on top of the virtual
keyboard popup when it is activated.  I tried calling
setCursor(blankcursor), but it doesn't work.  It's
relatively minor, just a cosmetic thing.

Other than the above notes, it works well (my
roommates like it), and is naturally applied wherever
there is a mythline edit.  Depending on certain
things, the new popup-ized MythLineEdit could replace
all the MythRemoteLineEdit functionality as well.

Other possible enhancements:

1) Make it look more attractive (maybe at least more
obvious when one of the keys is highlighted).
2) Support different sizes.
3) Support other keyboard layouts ;).
4) Allow selection of text by hitting shift lock and
using the left-right arrow keys.

Anyway, I'm not much of a myth developer, I was just
messing aroudn with this and thought I'd submit it. 
My apologies if I need to submit it in a different
format or something.  I'd love to hear some feedback -
I hope it's useful.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: virtual_keyboard-mythtv-0.18.1.diff
Type: text/x-patch
Size: 13656 bytes
Desc: 1955562824-virtual_keyboard-mythtv-0.18.1.diff
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050626/6b489687/virtual_keyboard-mythtv-0.18.1.bin

More information about the mythtv-dev mailing list