What is the clenest way to intriduce a scanner into System Settings?
I have a Brother DCP7065DN printer with a built-in scanner. I have the scanner working well,so the software isn't a problem. But how would I add the scanner to the Input Devices section of System Settings? Perhaps this is just a matter of aesthetics. The list of input devices includes keyboards, mice, game controllers, graphic tablets, and touchpads. It would seem that scanners should be on the list too, though I don't have any good ides as to what that section of System Settings might include, other than a list of installed scanners -- usually just one.
Solution 1:
Short answer is "You probably shouldn't try to do this". Read on for a brief explanation as to why.
The "Input Devices" section of the System Settings is determined by reading through udev
to identify devices that have been configured for use. In order to be considered an input device, the driver for the hardware must contain the following line in its udev
properties:
ID_INPUT=1
Depending on what sort of input the device provides, there will be additional properties that further define how the OS should interface with the hardware. Here are a list of the current valid input types:
ID_INPUT
ID_INPUT_MOUSE
ID_INPUT_TABLET
ID_INPUT_TOUCHSCREEN
ID_INPUT_JOYSTICK
ID_INPUT_KEY
ID_INPUT_KEYBOARD
Once the basic properties are set, there are additional properties associated with the device based on the drivers provided by the kernel, the manufacturer, or both. An example of the properties for a keyboard on a Lenovo ThinkPad might look like this:
P: /devices/platform/i8042/serio0/input/input4/event4
E: DEVNAME=/dev/input/event4
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: XKBMODEL=pc109
E: XKBLAYOUT=jp
E: XKBVARIANT=nodeadkeys
E: x11_driver=evdev
Note: This is taken from my Lenovo ThinkPad Carbon X1, which has a Japanese keyboard. Your configuration will likely differ.
The three ID_INPUT
flags report the device as being for input, with keys, and as a keyboard (as opposed to an electronic piano). The X
-prefixed flags provide additional details to Xorg for how to understand the input as it hits the buffer.
In order for you to have your scanner appear in the Input Devices section, you will need to configure its udev
rules to appear as a mouse, tablet, touchscreen, game controller, keyed device, or keyboard. Scanners generally do not offer any of these things for a computer to monitor or interface with. To make things more difficult, even if you were to hack together a custom udev
rule, the UI for the properties window would be completely wrong as the system would not have a clear understanding of what options for input actually exist.
In other words, you would need to write a custom driver from scratch to simulate the various inputs and treat them as scanner properties. This is not an impossible task, but it's not one that could be hammered out in a weekend, either.
So, coming back to the very first sentence of the answer, you probably shouldn't try to do this 🤐