I am in nearly unknown territory, since mostly I have been in the ASCII world
with chars from a to z.
Could you check the event.keyval for character 'C' on your keyboard and see
what character code is returned. Use printf to view the value. Then use this
value in the comparison instead of 'C'. Please let me know if it works ( I want
to know too!).
Ken
--- On Sun, 31/1/10, Yann Leboulanger <[email protected]> wrote:
From: Yann Leboulanger <[email protected]>
Subject: Re: detect ctrl+c in key_press_event handler
To: [email protected]
Date: Sunday, 31 January, 2010, 2:06 AM
Ken Resander wrote:
> Hi Yann,
>
> Doing it the long way may work...
>
> static bool ctrldown = false ;
> char codeforctrlkey = GDK_Control_L; // or whatever code is returned
>
> gboolean keypresscallback ( GtkWidget * w, ...)
> {
> if ( event->keyval == codeforctrlkey )
> {
> ctrldown = true ;
> }
> else if ( ctrldown && (event->keyval == 'C') )
> {
> // action
> }
> }
>
> gboolean keyreleasecallback ( GtkWidget * w, ...)
> {
> if ( event->keyval == codeforctrlkey )
> {
> ctrldown = false ;
> }
> }
>
> Ken
>
> --- On *Sat, 30/1/10, Yann Leboulanger /<[email protected]>/* wrote:
>
>
> From: Yann Leboulanger <[email protected]>
> Subject: detect ctrl+c in key_press_event handler
> To: [email protected]
> Date: Saturday, 30 January, 2010, 5:23 AM
>
> Hi all,
>
> I'd like to detect a ctrl+C in a key_press_event handler. I wrote (in
> pygtk):
>
> keyc, mod = gtk.accelerator_parse('<Control>c')
> if event.state & mod and event.keyval == keyc:
> blabla
>
> But that doesn't work on non-latin (russian) keyboard.
>
> On those keyboard, keyc is 0
>
> What's the correct way to detect that?
>
> Thanks for your help
> --
> Yann Leboulanger
> _______________________________________________
> gtk-list mailing list
> [email protected] </mc/[email protected]>
unfortunatly that doesn't work. event->keyval == 'C' doesn't work in
non-latin keyboard
_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list
Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com.
http://mail.promotions.yahoo.com/newdomains/aa/_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list