[PATCH] xkb: Fix repeat behaviour of redirect and message actions

wettstein509 at solnet.ch wettstein509 at solnet.ch
Tue Jan 29 12:41:03 PST 2013


> yes pleas. and tbh, I was hoping for something stronger than "I believe" :)

Well, it did build for me, so I have to guess what is different...

> do you have a good test-case for this one?

Using this:

    key <FK06> {
        type= "THREE_LEVEL",
        symbols[Group1]= [           NoSymbol,         NoSymbol, KP_3 ],
	actions[Group1]= [ RedirectKey(key=<KP1>), RedirectKey(key=<KP2>,clearMods=Shift), RedirectKey(key=<FK06>) ]
    };

Regarding the (re)moved 'return 0' in particular, press and hold F6 and
then another key while F6 is still down; that other key should not be
suppressed.

Otherwise, one can try out the various different orders of
pressing/releasing Shift, ISO_Level3_Shift, and F6 and check whether the
results are correct.  Apart from creating KP_1, KP_2 and KP_3, this also
means that all keys that get pressed also get released.  Finally, one
can try with autorepeat, pressing and releasing Shift and
ISO_Level3_Shift while FK06 autorepeats.

For the changes to action messages:

    key <FK06> {
        type= "TWO_LEVEL",
        symbols[Group1]= [           KP_3,         KP_2 ],
	actions[Group1]= [ ActionMessage(report=all,data="Base", genkeyevent), ActionMessage(report=all, data="Shift", genkeyevent=no) ]
    };

There are a few more options to test, namely, 'report=press' and
'report=release'.  With a little program one can observe what
action messages get sent:

-------------------------------------------------------------------------------
#include <X11/Xlibint.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <stdio.h>

int main(int argn, char** argv){
    int xkbbasecode, errcode, statcode;
    Display* dpy = XkbOpenDisplay(NULL, &xkbbasecode, &errcode, NULL, NULL, &statcode);

    XkbSelectEvents(dpy, XkbUseCoreKbd, XkbActionMessageMask, XkbActionMessageMask);

    while(1){
	XkbEvent event;
	XNextEvent(dpy, &event.core);
	if(event.type == xkbbasecode){
	    if(event.any.xkb_type == XkbActionMessage){
		const char* m = event.message.message;
		const unsigned int kc = event.message.keycode;
		printf("Keycode %d press %d message %s\n", kc, event.message.press, m);
	    }
	}
    }

    return 0;
}
-------------------------------------------------------------------------------

Regards,

Andreas


More information about the xorg-devel mailing list