randoragon / mousemode

An intuitive, home-row mouse replacement.
MIT License
7 stars 1 forks source link

[Solved] Rouge-like configuration #1

Open hisacro opened 7 months ago

hisacro commented 7 months ago

Hey! just wanted to say thanks, this is straightforward and awesome piece of code. Yesterday when I was going for dissertation defense review milk container spill, ruining my touchpad - again hearty thanks for this I was able to successfully finish it up today, little nuisance in the beginning but I was able to create a configuration that suited - thought I will share here if someone's interested, it should come very handy for people who are familar with rouge-like games.

    /* 
     *     rouge-like    scroll       Speed          
     *      y  k  u        o     
     *       \ | /         |       (c)...(f)aster
     *    h --   -- l      |                               
     *       / | \         |         (q)uit                              
     *     b   j  n        e                                       
     */
    isleft    = (iskeydown(XK_h)) || (iskeydown(XK_y)) ||  (iskeydown(XK_b))?  1 : 0;
    isdown    = (iskeydown(XK_j)) || (iskeydown(XK_n)) ||  (iskeydown(XK_b))?  1 : 0;
    isup      = (iskeydown(XK_k)) || (iskeydown(XK_y)) ||  (iskeydown(XK_u))?  1 : 0;
    isright   = (iskeydown(XK_l)) || (iskeydown(XK_u)) ||  (iskeydown(XK_n))?  1 : 0;

    ism1      = iskeydown(XK_a); /* left click   */
    ism2      = iskeydown(XK_s); /* middle click */
    ism3      = iskeydown(XK_d); /* right click  */
    ism4      = iskeydown(XK_o); /* up   scroll  */
    ism5      = iskeydown(XK_e); /* down scroll  */

and

  root = RootWindow(dpy, DefaultScreen(dpy));
    {
        grabkey(XK_q);                               /* quit    */
        grabkey(XK_a); grabkey(XK_s); grabkey(XK_d); /* mouse   */ 
        grabkey(XK_e); grabkey(XK_o);                /* scrolls */
        grabkey(XK_f); grabkey(XK_c);                /* speed   */
        grabkey(XK_h); grabkey(XK_j); grabkey(XK_k); grabkey(XK_l); /* vim-only */
        grabkey(XK_y); grabkey(XK_u); grabkey(XK_b); grabkey(XK_n); /* rouge-like */
    }

Again thanks for keeping codebase clean! cheers and have a great day

randoragon commented 7 months ago

Thanks for the kind words and the config. And well done on your dissertation, if mousemode ever gets one of those pretty websites that greet you with inspirational quotes and testimonies of satisfied users, your story will be perfect :^)
I'll keep this open for interested people to see.