#12278 NORM 13.1.0: OSK opened by keyboard frame device does not send key events

Zarro Boogs per Child bugtracker at laptop.org
Tue Nov 6 11:11:57 EST 2012


#12278: OSK opened by keyboard frame device does not send key events
--------------------------------------------+-------------------------------
           Reporter:  dsd                   |       Owner:  dsd          
               Type:  defect                |      Status:  new          
           Priority:  normal                |   Milestone:  13.1.0       
          Component:  keyboards, on-screen  |     Version:  not specified
         Resolution:                        |    Keywords:               
        Next_action:  never set             |    Verified:  0            
Deployment_affected:                        |   Blockedby:               
           Blocking:                        |  
--------------------------------------------+-------------------------------

Comment(by dsd):

 Originally filed at http://bugs.sugarlabs.org/ticket/4054


 This is harder than it might sound.

 The OSK normally works as follows: certain GTK+ input elements (e.g.
 GtkInput) have special code that calls into the input method when the
 focus happens. The maliit IM then contacts the maliit server over dbus
 saying "I'm an active input field!".

 Maliit server responds by recording that the client is active, then when
 the user clicks on the OSK keys, it sends dbus messages back to the active
 client. The maliit IM in receives those messages, and since it is an IM
 for an active text field, it has the ability to ask GTK+ to insert
 characters.

 The case when the OSK is manually triggered is very different. In this
 case, the maliit server has no idea which app has the active text input
 field, so it doesn't know where to send the messages. The app is probably
 not even listening for those messages - if the OSK has to be pulled up
 manually we can assume that we don't have a GTK IM context (because we're
 not working with a GtkEntry or something).

 This situation must be handled with some different approach to simulating
 keyboard events. One option would be for maliit-server to detect the
 situation where it doesn't have an active IM client, and in such case, use
 XSendEvent or XTest to inject a regular keypress to the active window at
 the X level.

 Maliit upstream acked the idea:  http://lists.maliit.org/pipermail/maliit-
 discuss-maliit.org/2012-November/000256.html

 But, coming down to implementation, this seems like a dead end. XTest and
 XSendKey are limited to keys that are on the physical keyboard, and even
 being able to access all the keys seems difficult.

 I posted to the xorg list to see if there are other alternatives.
 http://lists.x.org/archives/xorg/2012-November/055033.html

 Also, perhaps I could have 5 minutes of Carlos G's time to see if he has
 ideas?

-- 
Ticket URL: <http://dev.laptop.org/ticket/12278#comment:1>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list