Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4054 closed defect (notsugar)

OSK opened by keyboard frame device does not send key events

Reported by: garycmartin Owned by: dsd
Priority: Unspecified by Maintainer Milestone:
Component: Sugar Version: 0.97.x
Severity: Unspecified Keywords: 13.1.0
Cc: erikos Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

Opening the OSK using the keyboard frame device and typing does not actually send key events anywhere (useful at least). Typing on the OSK raised by the device icon does nothing.

Sugar shell, steps to reproduce:
1) in ebook mode
2) on the home favourites view
3) raise the frame
4) tap the frame keyboard device
5) start typing on the OSK

Result:

  • Nothing happens (other than the OSK happily accepting your typing)

Expectations:

  • The typed text should trigger focus to the 'Search In Home' widget, filtering the view

Calculate, steps to reproduce:
1) in ebook mode
2) start calculate
3) note that tapping the Label field raises the OSK
4) tap the main calculate input field (OSK is hidden so you can use the canvas buttons)
5) raise the frame
4) tap the frame keyboard device
5) start typing on the OSK

Result:

  • Nothing happens (other than the OSK happily accepting your typing)

Expectations:

  • The typed text should be going into the main calculate input field, just like you were typing on the physical keyboard

Turtle Art, steps to reproduce:
1) in ebook mode
2) start turtle art
3) switch to the Palette of variable blocks (open box icon)
4) drag the green text block onto the canvas
5) tap it to give it focus (a cursor will appear)
6) raise the frame
7) tap the frame keyboard device
8) start typing on the OSK

Result:

  • Nothing happens (other than the OSK happily accepting your typing)

Expectations:

  • The typed text should be going into the text block, just like you were typing on the physical keyboard

Change History (5)

comment:1 Changed 8 years ago by dsd

  • Owner changed from erikos to dsd
  • Status changed from new to assigned

comment:2 Changed 8 years ago by dsd

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.

I will try to follow up on this diagnosis and idea with maliit upstream before continuing.

comment:3 Changed 8 years ago by dsd

  • Cc erikos added

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?

comment:4 Changed 8 years ago by dsd

  • Resolution set to notsugar
  • Status changed from assigned to closed

comment:5 Changed 8 years ago by dnarvaez

  • Milestone 0.98 deleted

Milestone 0.98 deleted

Note: See TracTickets for help on using tickets.