You are not logged in.

#1 2020-08-24 16:49:50

adrianmay
Member
Registered: 2017-12-19
Posts: 64

Map mouse wheel to kb with repeat

For mouse pointing, I use a webcam and a crash-test-dummy-style headband, so now I want all other mouse functions as keyboard shortcuts.

I mapped the three buttons to the left hand home keys with right alt by doing this:

    key <AC02> {
        type[group1]= "FOUR_LEVEL_SEMIALPHABETIC",
        symbols[Group1]= [               s,               S, Pointer_Button3,         section ],
        symbols[Group2]= [               s,               S ],
        symbols[Group3]= [          ssharp ]
    };
    key <AC03> {
        type[group1]= "FOUR_LEVEL_ALPHABETIC",
        symbols[Group1]= [               d,               D, Pointer_Button2,             ETH ],
        symbols[Group2]= [               d,               D ],
        symbols[Group3]= [             eth,             ETH ]
    };
    key <AC04> {
        type[group1]= "FOUR_LEVEL_SEMIALPHABETIC",
        symbols[Group1]= [               f,               F, Pointer_Button1,     ordfeminine ],
        symbols[Group2]= [               f,               F ],
        symbols[Group3]= [         dstroke,         Dstroke ]
    };

in the file you extract and reinsert with xkbcomp.

Now I want to replicate mousewheel scrolling. The above technique didn't work but putting this:

    interpret KP_Subtract+AnyOfOrNone(all) {
        repeat= True;
        action= PtrBtn(button=4);
    };
    interpret KP_Add+AnyOfOrNone(all) {
        repeat= True;
        action= PtrBtn(button=5);
    };

in the same file works but without auto-repeat.

I didn't want it all the way over there on the numeric keypad but would rather have it near the first mapping, e.g. right alt with e and r, or q and a. Perhaps I'd get used to that if the ordinary mouse buttons were on PrtSc, Scroll Lock and Pause, which I can also do.

But wherever it is, it kinda needs auto repeat. It's weird cos the entries above say auto-repeat, as does the one for regular mouse buttons on NumPad-5, which obviously should not auto-repeat cos you often hold them down for dragging, highlighting, etc.

Has xkb anticipated that the scroll wheel switches are different from the usual mouse buttons in this way, or allowed for the repeat behaviour to differ between them? Or has it just hard coded all repetition out of mousekeys?

Anybody got another approach?

TIA, Adrian.

Last edited by adrianmay (2020-08-24 16:53:36)

Offline

Board footer

Powered by FluxBB