You are not logged in.

#1 2023-03-29 07:55:38

khlsvr
Member
Registered: 2023-03-29
Posts: 3

mousekeys configuring at plug in time

I like to use the mouse keys feature a lot https://en.wikipedia.org/wiki/Mouse_keys

I have problem in that I use a custom acceleration settings and at the same time my keyboard gets occasionally unplugged and replugged for a brief moment, as the cable moves slightly when I move the physical keyboard around a bit. This unplug+replug is pretty much invisible to me other than that my custom mouse keys settings gets resetted, and I have to manually run a command to set them back.

The commands to get my custom settings are done using https://aur.archlinux.org/packages/xkbset tool and are: `xkbset exp "=mousekeys"` and  `xkbset ma 80 2 200 5 2000`. By default the mouse keys feature has an expiry time when it turns automatically off, and the first command of those two changes that setting so that it won't turn off after the set time expires. The second command sets acceleration values. Also the autorepeat rate gets resetted, so I also need to run `xset r rate 280 40`. Well I actually have a bash alias to run all those 3 in one command.

I have learned, that probably if I could get these settings applied at /etc/X11/xorg.conf.d/00-keyboard.conf they would then persist, or get set automatically during the replugin. I have read the `man 4 evdev` and `man 4 libinput`. They show options for input devices including mouse accelerations, but they are probably not about the mouse keys acceleration that xkbset is modifying, right? If I were to find the exact options, then I would need to find out the parameter name/value for them when using localectl tool.

For the autorepeat I can see a correct setting to be added to /etc/X11/xorg.conf.d/00-keyboard.conf is shown at https://wiki.archlinux.org/title/Xorg/K … tion_files on 5.3. Using AutoRepeat configuration option. It should be `Option "AutoRepeat" "280 40"` under Section InputClass. However I can't find the exact parameter names/values to be used to add that using localectl tool. I tried reading its man page but I didn't understand. I can see on that aforementioned URL that I could also set autorepeat with a tool called xautocfg, but I would prefer using configuration option (localectl).

Last edited by khlsvr (2023-03-29 08:00:21)

Offline

#2 2023-03-29 12:16:39

seth
Member
Registered: 2012-09-03
Posts: 51,900

Re: mousekeys configuring at plug in time

However I can't find the exact parameter names/values to be used to add that using localectl tool.

I doubt localectl will somehow expose that config, it was dead and then hidden for a long time and it's also completel "locale" unrelated.
You can edit the config or add an augmenting configlet.

Likewise the xkb option for the pointer keys, https://wiki.archlinux.org/title/Access … Mouse_keys

Online

#3 2023-03-30 10:50:32

khlsvr
Member
Registered: 2023-03-29
Posts: 3

Re: mousekeys configuring at plug in time

Ok thanks. I added now manually the `Option "AutoRepeat" "280 40"` to the file /etc/X11/xorg.conf.d/00-keyboard.conf and it works. After unplug/replug the autorepeat rate is as I want and now one of the problems is solved.

I already had in that configuration file the line to start the mousekeys: `Option "XkbOptions" "keypad:pointerkeys" ` but it's not enough to address the mousekeys settings related issue, which is that I lose the mouse acceleration values and the expiry time setting upon unplug. I'm still looking for the options for these settings.

Through this URL https://wiki.archlinux.org/title/X_keyb … se_control I can find some exotic stuff where an answer might be, but I am struggling to find it. I mean in addition to that info in section 12.1 on that page, the sections 15.2 and 16 could lead to some answers. The link on 15.2 for using rules led me to check those *.lst files in /usr/share/X11/xkb/rules/ They seem to have a long list of available options, but by the looks of it, there seems to be only this one option related to pointerkeys, which is the one I am using for enabling them. For example it's mentioned in /usr/share/X11/xkb/rules/base.lst line 951 keypad:pointerkeys   Shift + Num Lock enables PointerKeys.

Offline

#4 2023-03-30 12:17:13

seth
Member
Registered: 2012-09-03
Posts: 51,900

Re: mousekeys configuring at plug in time

https://wiki.archlinux.org/title/Access … Mouse_keys
If the mousekey pointer accel isn't different from the regular one, https://wiki.archlinux.org/title/Mouse_ … figuration

As for the expiration date, toggling the feature w/ Sift+Numlock isn't infinitely?

Online

#5 2023-04-03 09:33:53

khlsvr
Member
Registered: 2023-03-29
Posts: 3

Re: mousekeys configuring at plug in time

From the xkbset manual:

` [-]{mousekeysaccel | ma} [mk-delay> <mk_interval> <mk_time_to_max mk-max_speed> <mk_curve]`

Setting the mousekeys acceleration takes 5 values called delay, interval, time to max, max speed and curve. The mouse acceleration settings shown in https://wiki.archlinux.org/title/Mouse_ … figuration are probably just for the mouse itself. The page has no mention about delay, interval or "max".

Yeah, the mousekeys functionality by default turns automatically off after 120 seconds has elapsed after which you have to press shift+numlock again to activate it again.

Offline

Board footer

Powered by FluxBB