After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654821 - Keymap.get_entries_for_keyval isn't working properly
Keymap.get_entries_for_keyval isn't working properly
Status: RESOLVED DUPLICATE of bug 653588
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-18 08:57 UTC by Javier Hernández
Modified: 2011-08-14 09:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
get_entries_for_keyval using c (695 bytes, text/x-csrc)
2011-07-18 08:57 UTC, Javier Hernández
Details

Description Javier Hernández 2011-07-18 08:57:36 UTC
Created attachment 192165 [details]
get_entries_for_keyval using c

Hi!

I'm porting my application and I'm having some problems with this method.

First of all, using the old pygtk bindings, was like this:

import gtk
km = gtk.gdk.keymap_get_default()
entries = km.get_entries_for_keyval(36)

entries now contains: ((13,0,1), (13,0,3))


Now, using pygobject:

from gi.repository import Gdk
km = Gdk.Keymap.get_default()

success, entries = km.get_entries_for_keyval(36)

entries now contains: [<void at 0x94623f8>, <void at 0x9462404>]

each entry should be a Gdk.KeymapKey, and it is, but it's respective attributes (keycode, group, level) aren't setted properly. This three attributes are gint, but we're getting long types and they're not the right values.
Addingly, I ocasionally get coredumps by calling this method.

I did a test using c, and this method is working properly, returned keymapkey's attributes are gint types. That's the reason because i'm filling the bug in pygobject. You can try running it by passing the keyval from the command line, I'm passing 36, as in python's examples. 

Thanks and best regards!
Comment 1 Sebastian Pölsterl 2011-08-14 09:41:55 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 653588 ***