Re: How to trap MappingNotify event in gtk/gdk?
- From: Owen Taylor <otaylor redhat com>
- To: DIWAKAR SAMBHARE <diwakarsam yahoo co uk>
- Cc: gtk-devel-list gnome org
- Subject: Re: How to trap MappingNotify event in gtk/gdk?
- Date: 28 Feb 2003 11:27:54 -0500
On Fri, 2003-02-28 at 03:53, DIWAKAR SAMBHARE wrote:
> Hi,
>
> My gtk application needs to trap MappingNotify event
> which is generated and sent to all client applications
> when keyboard map in memory is changed as a result of
> XChangeKeyboardMapping().
>
> I tried to capture this event using
> gdk_window_add_filter() before events are sent to gdk
> internal event handling functions. But the
> MappingNotify event does not seem to reach to the
> filter function; even though other events are captured
> in this filter function. Is it because of the fact
> that there is no window associated with MappingNotify
> event or is it something else?
You should be able to get it using a window of NULL
in gdk_window_add_filter(). But you must return
GDK_FILTER_CONTINUE or you'll break GTK+, since it
needs to get the MappingNotify event as well.
> I also looked into gdk event handling code
> (gdkevents.c) and fouind out that on MappingNotify
> event, gdk call XRefreshKeyboard() function and then
> blocks it from further processing.
>
> Is there any way in which I can still trap
> MappingNotify event using gdk?
The approved way of catching a change in keyboard mapping
is to connect to the ::keys-changed signal on GdkKeymap
(new in GTK+-2.2)
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]