Re: [pygtk] help: how to build text from keypress and dead/compose keys ?

2003-11-04 Thread Christian Robottom Reis
On Fri, Oct 31, 2003 at 03:25:50AM -0300, alejandro david weil wrote:
  I hooked key_press event.. and all was ok until I wanted to 'handle' 
 deadkeys .. well actually.. the deadkey event comes as a keypress.
 
  But I can't handle it, I could save it for later use.. but still don't know
 how can I use that when other key comes.

Okay, you'll have to help me here -- why do you want to use a deadkey in
your specific application? Normally deadkeys are taken care of at the
underlying X level, no?

  When a keypress comes I do:
   1. check it's a keypress event
   2. check if keyval  0xff00 == 0xff00, if it's that, - contrrol key
   3. if not control key:
   4.  oldstr = oldstr +  unichar(gtk.gdk.keyval_to_unicode( keyval ))

[snip]

 Is there some kind of value that I can keep, to process next keypress
 with, in order to apply the char modification?

You can do all this manually by storing something like self._last_key
(you could even store it as widget.set_data(_last_key, XXX) and then
blocking insert_text (and setting it yourself) if you really wanted.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] help: how to build text from keypress and dead/compose keys ?

2003-10-30 Thread alejandro david weil
Hi!

 I hooked key_press event.. and all was ok until I wanted to 'handle' 
deadkeys .. well actually.. the deadkey event comes as a keypress.

 But I can't handle it, I could save it for later use.. but still don't know
how can I use that when other key comes.

 When a keypress comes I do:
1. check it's a keypress event
2. check if keyval  0xff00 == 0xff00, if it's that, - contrrol key
3. if not control key:
4.  oldstr = oldstr +  unichar(gtk.gdk.keyval_to_unicode( keyval ))

Well I must check that keyval_to_unicode doesn't return 0L.

But, is keyval_to_unicode the function that I should call? 

I saw that there are some gtk_im_context methods/classes.. 
are them for this kind of things? (i don't found information about
that functions)..

Is there some kind of value that I can keep, to process next keypress
with, in order to apply the char modification?

Thanks in advance!

-- 
+ There is no dark side of the moon really. Matter of fact it's all dark.


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/