MOUSED(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸŽ€ MOUSED(8) πŸŽ€

okay bestie, so this is the moused page from the System Manager's Manual β€” yes, section 8, the big-kid system administration section, we love a legend. Sit down, grab a strawberry drink πŸ“, and let me tell you about the little daemon that makes your mouse actually do things in a text console. πŸ’…


✨ NAME ✨

moused β€” the whole vibe is: it takes your mouse data and hands it straight to the console driver. that's it. that's the job. 🐭


πŸ¦‹ SYNOPSIS πŸ¦‹

moused [-dfg] [-I file] [-F rate] [-r resolution]
       [-VH [-U distance -L distance]] [-A exp[,offset]] [-a X[,Y]]
       [-C threshold] [-m N=M] [-w N] [-z target] [-t interfacetype]
       [-l level] [-3 [-E timeout]] [-T distance[,time[,after]]] -p port

moused [-d] -p port -i info

two whole invocation forms, both iconic, both requiring -p port because the port is not optional, bestie. not even a little. πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

so the moused utility and the console driver are literally a duo β€” a main-character team-up 🀝 β€” and together they support mouse operation in the text console and in user programs. They virtualize the mouse and hand user programs mouse data in the standard format (peep sysmouse(4) for the deets).

The mouse daemon listens to the specified port for mouse data, interprets it, and then passes it via ioctls to the console driver. The supported data interfaces are "input event device" AKA evdev, and sysmouse(4) level 1. The mouse daemon reports translation movement, button press/release events, and movement of the roller or the wheel if available. And the roller/wheel movement? Reported as β€œZ” axis movement. highkey a whole extra dimension, we love to see it. ✨

The console driver will display the mouse pointer on the screen and provide cut and paste functions β€” but only if the mouse pointer is enabled in the virtual console via vidcontrol(1). And if sysmouse(4) is opened by a user program, the console driver also passes the mouse data to the device so the user program will see it. sharing is caring fr fr 🫢


🌸 the signals, aka moused's mood ring 🌸

  • SIGHUP β€” if the mouse daemon receives it, it will reopen the mouse port and reinitialize itself. Super useful if the mouse gets attached/detached while the system is suspended. like a little refresh button for your mouse's whole soul 😭
  • SIGUSR1 β€” if the mouse daemon receives it, it will stop passing mouse events. Send SIGUSR1 again and it resumes. The classic use case: your typing on a laptop keeps getting interrupted by your palm accidentally touching the mouse pad. privacy please!! πŸ™ˆ

⭐ the options (the menu, the whole menu, nothing but the menu) ⭐

The following options are available:

  • -3 β€” emulate the third (middle) button for 2-button mice. It's emulated by pressing the left and right physical buttons simultaneously. one in each hand, go πŸ’…
  • -C threshold β€” set double click speed as the maximum interval in msec between button clicks. Without this option, the default value of 500 msec will be assumed. Heads up though: this option will have effect only on the cut and paste operations in the text mode console. The user program which is reading mouse data via sysmouse(4) will not be affected. so don't come for the daemon when your app ignores it, okay? πŸŽ€
  • -E timeout β€” when the third button emulation is enabled (see -3 above, bestie, keep up), the moused utility waits timeout msec at most before deciding whether two buttons are being pressed simultaneously. The default timeout is 100 msec.
  • -F rate β€” only for sysmouse(4) interface. Set the report rate (reports/sec) of the device if supported. if supported!! read the room 🫠
  • -L distance β€” when β€œVirtual Scrolling” is enabled, the -L option can be used to set the distance (in pixels) that the mouse must move before a scroll event is generated. This effectively controls the scrolling speed. The default distance is 2 pixels.
  • -H β€” enable β€œHorizontal Virtual Scrolling”. With this option set, holding the middle mouse button down will cause motion to be interpreted as horizontal scrolling. Use the -U option to set the distance the mouse must move before the scrolling mode is activated, and the -L option to set the scrolling speed. This option may be used with or without the -V option. horizontal slay πŸ”₯
  • -I file β€” write the process id of the moused utility in the specified file. Without this option, the process id will be stored in /var/run/moused.pid. consider yourself doxxed, but like, in a helpful way.
  • -T distance[,time[,after]] β€” terminate drift. Use this option if the mouse pointer slowly wanders when the mouse is not moved. Movements up to distance (for example 4) pixels (X+Y) in time msec (default 500) are ignored, except during after msec (default 4000) since the last real mouse movement. your pointer is not possessed, it's just drifting, we can fix that πŸ’€
  • -V β€” enable β€œVirtual Scrolling”. With this option set, holding the middle mouse button down will cause motion to be interpreted as scrolling. Use the -U option to set the distance the mouse must move before the scrolling mode is activated, and the -L option to set the scrolling speed. the vertical sibling of -H, they're twins, it's giving matching outfits πŸ‘‘
  • -U distance β€” when β€œVirtual Scrolling” is enabled, the -U option can be used to set the distance (in pixels) that the mouse must move before the scrolling mode is activated. The default distance is 3 pixels.
  • -A exp[,offset] β€” apply exponential (dynamic) acceleration to mouse movements: the faster you move the mouse, the more it will be accelerated. That means small mouse movements are not accelerated, so they are still very accurate, while a faster movement will drive the pointer quickly across the screen. okay so this is the ✨smart✨ one, and here's the breakdown:
    • The exp value specifies the exponent, which is basically the amount of acceleration. Useful values are in the range 1.1 to 2.0, but it depends on your mouse hardware and your personal preference. A value of 1.0 means no exponential acceleration. A value of 2.0 means squared acceleration (i.e. if you move the mouse twice as fast, the pointer will move four times as fast on the screen). Values beyond 2.0 are possible but not recommended. A good value to start is probably 1.5. 🧚
    • The optional offset value specifies the distance at which the acceleration begins. The default is 1.0, which means that the acceleration is applied to movements larger than one unit. If you specify a larger value, it takes more speed for the acceleration to kick in, i.e. the speed range for small and accurate movements is wider. Usually the default should be sufficient, but if you're not satisfied with the behaviour, try a value of 2.0.
    • > ngl this is important: note that the -A option interacts badly with the X server's own acceleration, which doesn't work very well anyway. Therefore it is recommended to switch it off if necessary: xset m 1. you've been warned, bestie 😭
  • -a X[,Y] β€” accelerate or decelerate the mouse input. This is a linear acceleration only. Values less than 1.0 slow down movement, values greater than 1.0 speed it up. Specifying only one value sets the acceleration for both axes. You can use the -a and -A options at the same time to have the combined effect of linear and exponential acceleration. combo move, we love a collaboration 🌈
  • -d β€” enable debugging messages. the daemon starts oversharing πŸ—£οΈ
  • -f β€” do not become a daemon and instead run as a foreground process. Useful for testing and debugging. lowkey my favourite way to run things, you can actually watch it ✨
  • -g β€” only for evdev interface. Become the sole recipient of all incoming input events. This prevents other processes from getting input events on the device. possessive? maybe. effective? yes. πŸ‘‘
  • -i info β€” print specified information and quit. Available pieces of information are:
    • port β€” port (device file) name, i.e. /dev/input/event0, /dev/ums0 and /dev/psm0.
    • if β€” interface type: β€œevdev” or β€œsysmouse”.
    • type β€” device type: β€œmouse” or β€œtouchpad”.
    • model β€” mouse model.
    • all β€” all of the above items. Print port, type and model in this order in one line.

If the moused utility cannot determine the requested information, it prints β€œunknown” or β€œgeneric”. it's not being shady, it just genuinely doesn't know 🫢

  • -l level β€” ignored. Used for compatibility with legacy moused. it's here, it's decorative, let it live πŸ’…
  • -m N=M β€” assign the physical button M to the logical button N. You may specify as many instances of this option as you like. More than one physical button may be assigned to a logical button at the same time. In this case the logical button will be down, if either of the assigned physical buttons is held down. Do not put space around =. this is the one time spacing betrays you 😀
  • -p port β€” use port to communicate with the mouse. the required one. the main character. the reason we're all here.
  • -r resolution β€” only for sysmouse(4) interface. Set the resolution of the device; in Dots Per Inch, or low, medium-low, medium-high or high. This option may not be supported by all the device. mood, honestly 🫠
  • -t type β€” force the interface type of the mouse attached to the port. You may explicitly specify a type listed below, or use auto to let the moused utility automatically select an appropriate protocol for the given character device. If you entirely omit this option in the command line, -t auto is assumed. Valid types for this option are listed below:
    • evdev β€” input event device usualy residing in /dev/input. (yes, "usualy", that's the manpage's spelling, not mine, I'm just the messenger 😭)
    • sysmouse β€” traditional protocol used by e.g. ums(4) and psm(4) drivers.
note that this option restricts usage of the given port rather then gives a hint. so no soft-launching here, it's a whole boundary. 🚧
  • -q config β€” path to configuration file. πŸ“
  • -Q quirks β€” path to quirks directory. quirky!! and yes, it's a real option even though the synopsis went and forgot it. icon behaviour tbh.
  • -w N β€” make the physical button N act as the wheel mode button. While this button is pressed, X and Y axis movement is reported to be zero and the Y axis movement is mapped to Z axis. You may further map the Z axis movement to virtual buttons by the -z option below. it's giving remix 🎧
  • -z target β€” map Z axis (roller/wheel) movement to another axis or to virtual buttons. Valid target maybe:
    • x
    • y β€” X or Y axis movement will be reported when the Z axis movement is detected.
    • N β€” report down events for the virtual buttons N and N+1 respectively when negative and positive Z axis movement is detected. There do not need to be physical buttons N and N+1. Note that mapping to logical buttons is carried out after mapping from the Z axis movement to the virtual buttons is done.
    • N1 N2 β€” report down events for the virtual buttons N1 and N2 respectively when negative and positive Z axis movement is detected.
    • N1 N2 N3 N4 β€” this is useful for the mouse with two wheels of which the second wheel is used to generate horizontal scroll action, and for the mouse which has a knob or a stick which can detect the horizontal force applied by the user. The motion of the second wheel will be mapped to the buttons N3, for the negative direction, and N4, for the positive direction. If the buttons N3 and N4 actually exist in this mouse, their actions will not be detected. πŸŒ€

Also bestie, fair warning: horizontal movement or second roller/wheel movement might just… not get detected?? 😭 Like, there's genuinely no accepted standard for how that gets encoded, so it's the wild west out here. Ngl it's giving "we all agreed to disagree."

And heads up: some mice think left is the negative horizontal direction, and others think the complete opposite. Rude. On top of that, there are mice out there whose two wheels are both mounted vertically, and the second vertical wheel's direction doesn't even match the first one 🫠 so yeah, vibe check your hardware.

Multiple Mice 🐭✨

The moused utility can operate in 2 different modes depending on the value of the -p option β€” choose your fighter πŸ’…

  • When started with -p auto specified, moused handles all recognized pointing devices in a single instance. Device hotplug is supported through devd(8) πŸ”₯ Only the evdev interface is available in this mode.
  • When started with -p <selected_port> specified, moused handles a single device located at <selected_port>. Both evdev and sysmouse(4) level 1 interfaces are available in this mode.

Multiple moused instances may be run simultaneously πŸ‘‘ β€” go off, run the whole squad.


🌸 FILES 🌸

  • /dev/consolectl β€” device to control the console
  • /dev/input/event%d β€” Input event device
  • /dev/psm%d β€” PS/2 mouse driver
  • /dev/sysmouse β€” virtualized mouse driver
  • /dev/ums%d β€” USB mouse driver
  • /var/run/moused.pid β€” process id of the currently running moused utility

πŸŽ€ EXAMPLES πŸŽ€

Okay so, bestie, here are the actual receipts 🧾✨

moused -p auto
vidcontrol -m on

Start the moused utility to handle all evdev pointing devices automatically with hotplug support. And then enable the mouse pointer in the text console after that. (Yes it says "after than" in the original β€” iconic typo energy, we keep it πŸ’€). The daemon can be started without the -p option as well, iykyk.

moused -f -d -g -p /dev/input/event0

Start the mouse daemon on the /dev/input/event0 in the exclusive foreground debug mode. Exclusive mode may disable mouse in Xorg session β€” so like, don't come for me when your cursor ghosts you in Xorg, that's the tradeoff πŸ™ˆ

moused -p /dev/input/event0 -m 1=3 -m 3=1

Assign the physical button 3 (right button) to the logical button 1 (logical left) and the physical button 1 (left) to the logical button 3 (logical right). This will effectively swap the left and right buttons πŸ”„ lefty gang rise up.

moused -p /dev/input/event0 -z 4

Report negative Z axis movement (i.e., mouse wheel) as the button 4 pressed and positive Z axis movement (i.e., mouse wheel) as the button 5 pressed. Scrolling's just buttons now, slay.


If you add

ALL ALL = NOPASSWD: /usr/bin/killall -USR1 moused

to your /usr/local/etc/sudoers file, and bind

killall -USR1 moused

to a key in your window manager, you can suspend mouse events on your laptop if you keep brushing over the mouse pad while typing 😀 honestly this is the single most relatable feature on this entire page, no cap.


πŸ¦‹ SEE ALSO πŸ¦‹

moused.conf(5), kill(1), vidcontrol(1), xset(1), keyboard(4), psm(4), sysmouse(4), ums(4), devd(8)


⭐ HISTORY ⭐

The moused utility first appeared in FreeBSD 2.2. It was rewritten to support multiple input event devices in FreeBSD 15.0 ✨ glow-up era.


πŸ‘‘ AUTHORS πŸ‘‘

  • The moused utility was originally written by Michael Smith <msmith@FreeBSD.org>.
  • This manual page was written by Mike Pritchard <mpp@FreeBSD.org>.
  • The command and manual page have since been updated by Kazutaka Yokota <yokota@FreeBSD.org>.
  • Multiple input event devices support was added by Vladimir Kondratyev <wulf@FreeBSD.org>.

Legends, all of them 🫢


πŸ’€ CAVEATS πŸ’€

Cut and paste functions in the virtual console assume that there are three buttons on the mouse. Like, bestie, it assumes 😭

  • The logical button 1 (logical left) selects a region of text in the console and copies it to the cut buffer.
  • The logical button 3 (logical right) extends the selected region.
  • The logical button 2 (logical middle) pastes the selected text at the text cursor position.

If the mouse has only two buttons, the middle, paste button is not available πŸ’” To obtain the paste function, use the -3 option to emulate the middle button, or use the -m option to assign the physical right button to the logical middle button: -m 2=3.

Fr fr, don't skip this part β€” a two-button mouse with no remap means no paste, and then you're stuck copy-pasting with your soul.

🌈 And that's the whole page, bestie!! This gem comes to you from the Debian crew with the date June 14, 2025 stamped on it β€” go forth and mouse responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ“œ the page's license: BSD-4-Clause
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms