[PATCH v3 0/9] Hardware keyboard input for input methods v3

Kristian Høgsberg hoegsberg at gmail.com
Tue Nov 27 12:11:17 PST 2012


On Sun, Nov 18, 2012 at 07:06:41PM +0100, Jan Arne Petersen wrote:
> From: Jan Arne Petersen <jpetersen at openismus.com>
> 
> >>>   text: Rename and extend text_model key event
> >> I'm holding off on this one and the remaining patches.  I think you're
> >> right that it's better to just add the events to text_model, but
> >> there's more to it than that.  We need a better approach to modifiers
> >> than what you have in the keysym event.  It needs to be compatible
> >> with the wl_keyboard modifier model.  That's a bitmask too, but you
> >> need the xkb keymap to understand what the bits mean
> >> (xkb_map_mod_get_index).  So we could add a keymap event to
> >> text_model, but it's a little expensive to send out and re-parse the
> >> xkb map, so I'd rather the text_model could grab it from the
> >> associated wl_keyboard (from wl_seat in text_model.enter).  I'd also
> >> rather use a modifier event like wl_keyboard than send the modifiers
> >> with each keysym event.
> >>
> >> Now if we use the keymap from the associated wl_seat, have a modifier
> >> event and the keysym event, do we still need text_model.get_keyboard?
> >> Do we ever need the key codes at this level?  And if we do, can we
> >> just get them from the real wl_keyboard?  That is, send out the
> >> keycode from wl_keyboard interface and the keysym from text_model?
> >>
> >> Hmm, and if we rely on wl_keyboard in text_model (for the keymap)
> >> should we just get modifier events from wl_keyboard as well?  That is,
> >> we only add the keysym event to text_model and keymap and modifiers
> >> come from the underlying wl_keyoard.
> > 
> > My current idea would be to add a modifier_names event to text_model, so
> > that an input method sends an array of known modifier names (which would
> > be the same used by xkb_keymap_mod_get_index). The mapping to a bitmask 
> > is than just done by the index of that modifier name in the array.
> 
> I implemented it that way in this patch series.

Yup, it looks fine now.  I ended up moving a few things around in the
weston-simple-im client.  Mainly I removed the keyboard-utils.[ch]
split and just included that in weston-simple-im, and removing the
extra abstraction layer.  The other change was making it not depend on
toytoolkit.  With these changes, I think weston-simple-im could be
developed into a real-world table based IM.

I've committed the patches as-is, but please keep lines under 80
characters; introduce temporary variables instead of building up
several nested calls and break inner loops into helper functions if
the nesting gets too deep.

Kristian

> Jan Arne Petersen (8):
>   text: Start input method from configuration
>   text: Rename and extend text_model key event
>   text: Send more information with keysym events
>   text: Add support for grabbing the keyboard
>   text: Add support for forwarding key events
>   window: Add utils for xkb keyboard input
>   window: Allow to get xkb context from display
>   text: Add simple compose input method
> 
> Rob Bradford (1):
>   editor: Add support for editing text using the keyboard
> 
>  clients/.gitignore         |   1 +
>  clients/Makefile.am        |  13 +-
>  clients/editor.c           | 153 ++++++++++++++++----
>  clients/keyboard-utils.c   | 173 +++++++++++++++++++++++
>  clients/keyboard-utils.h   |  67 +++++++++
>  clients/keyboard.c         |  68 +++++++--
>  clients/weston-simple-im.c | 338 +++++++++++++++++++++++++++++++++++++++++++++
>  clients/window.c           |  51 +++++++
>  clients/window.h           |  11 ++
>  protocol/input-method.xml  |  35 +++++
>  protocol/text.xml          |  22 ++-
>  src/compositor.c           |   5 +-
>  src/compositor.h           |  10 +-
>  src/text-backend.c         | 297 +++++++++++++++++++++++++++++++++++++--
>  weston.ini                 |   3 +
>  15 files changed, 1182 insertions(+), 65 deletions(-)
>  create mode 100644 clients/keyboard-utils.c
>  create mode 100644 clients/keyboard-utils.h
>  create mode 100644 clients/weston-simple-im.c
> 
> -- 
> 1.7.11.7
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list