Download Man Pages - LinuxCNC
Transcript
HAL_INPUT(1)
HAL User’s Manual
HAL_INPUT(1)
For keys
input.N.key-name
input.N.key-name-not
Created for each key on the device.
For absolute axes
input.N.abs-name-counts s32 out
input.N.abs-name-position float out
input.N.abs-name-scale parameter float rw
input.N.abs-name-offset parameter float rw
input.N.abs-name-fuzz parameter s32 rw
input.N.abs-name-flat parameter s32 rw
input.N.abs-name-min parameter s32 r
input.N.abs-name-max parameter s32 r
Created for each absolute axis on the device. Device positions closer than flat to offset are
reported as offset in counts, and counts does not change until the device position changes by at
least fuzz. The position is computed as position = (counts - offset) / scale. The default value of
scale and offset map the range of the axis reported by the operating system to [-1,1]. The default
values of fuzz and flat are those reported by the operating system. The values of min and max are
those reported by the operating system.
For relative axes
input.N.rel-name-counts s32 out
input.N.rel-name-position float out
input.N.rel-name-reset bit in
input.N.rel-name-scale parameter float rw
input.N.rel-name-absolute parameter s32 rw
input.N.rel-name-precision parameter s32 rw
input.N.rel-name-last parameter s32 rw
Created for each relative axis on the device. As long as reset is true, counts is reset to zero
regardless of any past or current axis movement. Otherwise, counts increases or decreases according to the motion of the axis. counts is divided by position-scale to give position. The default
value of position is 1. There are some devices, notably scroll wheels, which return signed values
with less resolution than 32 bits. The default value of precision is 32. precision can be set to 8
for a device that returns signed 8 bit values, or any other value from 1 to 32. absolute, when set
true, ignores duplicate events with the same value. This allows for devices that repeat events without any user action to work correctly. last shows the most recent count value returned by the
device, and is used in the implementation of absolute.
For LEDs
input.N.led-name bit out
input.N.led-name-invert parameter bit rw
Created for each LED on the device.
PERMISSIONS AND UDEV
By default, the input devices may not be accessible to regular users--hal_input requires read-write access,
even if the device has no outputs. To change the default permission of a device, add a new file to
/etc/udev/rules.d to set the device’s GROUP to "plugdev". You can do this for all input devices with this
rule:
SUBSYSTEM=="input", MODE="0660", GROUP="plugdev"
You can also make more specific rules for particular devices. For instance, a SpaceBall input device uses
the ’spaceball’ kernel module, so a udev entry for it would read:
DRIVER=="spaceball", MODE="0660", GROUP="plugdev"
the next time the device is attached to the system, it will be accessible to the "plugdev" group.
For USB devices, the udev line would refer to the device’s Vendor and Product values, such as
SYSFS{idProduct}=="c00e", SYSFS{idVendor}=="046d", MODE="0660", GROUP="plugdev"
LinuxCNC Documentation
2007-02-25
11