MOUSED(8)
π 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. SendSIGUSR1again 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 inmsecbetween button clicks. Without this option, the default value of500msecwill 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 viasysmouse(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-3above, bestie, keep up), themousedutility waitstimeoutmsecat most before deciding whether two buttons are being pressed simultaneously. The defaulttimeoutis100msec.-F rateβ only forsysmouse(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-Loption 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 defaultdistanceis2pixels.-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-Uoption to set the distance the mouse must move before the scrolling mode is activated, and the-Loption to set the scrolling speed. This option may be used with or without the-Voption. horizontal slay π₯-I fileβ write the process id of themousedutility 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 todistance(for example4) pixels (X+Y) intimemsec(default500) are ignored, except duringaftermsec(default4000) 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-Uoption to set the distance the mouse must move before the scrolling mode is activated, and the-Loption 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-Uoption can be used to set the distance (in pixels) that the mouse must move before the scrolling mode is activated. The defaultdistanceis3pixels.-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
expvalue specifies the exponent, which is basically the amount of acceleration. Useful values are in the range1.1to2.0, but it depends on your mouse hardware and your personal preference. A value of1.0means no exponential acceleration. A value of2.0means squared acceleration (i.e. if you move the mouse twice as fast, the pointer will move four times as fast on the screen). Values beyond2.0are possible but not recommended. A good value to start is probably1.5. π§ - The optional
offsetvalue specifies the distance at which the acceleration begins. The default is1.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 of2.0. - > ngl this is important: note that the
-Aoption 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 π
- The
-a X[,Y]β accelerate or decelerate the mouse input. This is a linear acceleration only. Values less than1.0slow down movement, values greater than1.0speed it up. Specifying only one value sets the acceleration for both axes. You can use the-aand-Aoptions 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 forevdevinterface. 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/ums0and/dev/psm0.ifβ interface type: βevdevβ or βsysmouseβ.typeβ device type: βmouseβ or βtouchpadβ.modelβ mouse model.allβ all of the above items. Printport,typeandmodelin 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 legacymoused. it's here, it's decorative, let it live π-m N=Mβ assign the physical buttonMto the logical buttonN. 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β useportto communicate with the mouse. the required one. the main character. the reason we're all here.-r resolutionβ only forsysmouse(4)interface. Set the resolution of the device; in Dots Per Inch, orlow,medium-low,medium-highorhigh. 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 useautoto let themousedutility automatically select an appropriate protocol for the given character device. If you entirely omit this option in the command line,-t autois assumed. Valid types for this option are listed below:
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 buttonNact as the wheel mode button. While this button is pressed,XandYaxis movement is reported to be zero and theYaxis movement is mapped toZaxis. You may further map theZaxis movement to virtual buttons by the-zoption below. it's giving remix π§-z targetβ mapZaxis (roller/wheel) movement to another axis or to virtual buttons. Validtargetmaybe:xyβXorYaxis movement will be reported when theZaxis movement is detected.Nβ report down events for the virtual buttonsNandN+1respectively when negative and positiveZaxis movement is detected. There do not need to be physical buttonsNandN+1. Note that mapping to logical buttons is carried out after mapping from theZaxis movement to the virtual buttons is done.N1 N2β report down events for the virtual buttonsN1andN2respectively when negative and positiveZaxis 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 buttonsN3, for the negative direction, andN4, for the positive direction. If the buttonsN3andN4actually 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 autospecified,mousedhandles all recognized pointing devices in a single instance. Device hotplug is supported throughdevd(8)π₯ Only the evdev interface is available in this mode. - When started with
-p <selected_port>specified,mousedhandles a single device located at<selected_port>. Both evdev andsysmouse(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 runningmousedutility
π 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
mousedutility 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
- Copyright (c) 1996 Mike Pritchard <mpp@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms