3.9. moused

This class handles all the settings for the moused daemon on the system and provides per-device input device management. Table 3.9.1 shows the parameters for moused requests:

Table 3.9.1 : Moused class request parameters
Parameter Value Description
id   Any unique value for the request, including a hash, checksum, or uuid.
name moused  
namespace sysadm  
action   “list_devices”, “list_devices_active”, “list_device_options”, “read_device_options”, “set_device_active”, “set_device_inactive”, “set_device_options”

The rest of this section provides examples of the available actions for each type of request, along with their responses.

3.9.1. List Devices

The list_devices action lists all detected devices on the system with additionally relevant information.

REST Request

{
   "action" : "list_devices"
}

WebSocket Request

{
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "moused",
   "args" : {
      "action" : "list_devices"
   }
}

Response

{
  "args": {
    "list_devices": {
      "psm0": {
        "description": "PS/2 Mouse",
        "device": "psm0",
        "driver": "psm",
        "parent": "atkbdc0"
      },
      "ums0": {
        "description": "YSTEK G Mouse, class 0/0, rev 1.10/0.01, addr 1",
        "device": "ums0",
        "driver": "ums",
        "parent": "uhub1",
        "active": "<"true" OR "false">"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

3.9.2. List Active Devices

The list_devices_active action lists all devices that are currently active.

REST Request

PUT /sysadm/moused
{
   "action" : "list_devices_active"
}

WebSocket Request

{
   "name" : "moused",
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "action" : "list_devices_active"
   }
}

Response

{
  "args": {
    "list_devices_active": {
      "active_devices": [
        "ums0"
      ]
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

3.9.3. List Device Options

list_device_options lists all the per-device options which can be changed, with lists of possible settings or a description of the possible settings types.

REST Request

PUT /sysadm/moused
{
   "action" : "list_device_options"
}

WebSocket Request

{
   "namespace" : "sysadm",
   "name" : "moused",
   "args" : {
      "action" : "list_device_options"
   },
   "id" : "fooid"
}

Response

{
  "args": {
    "list_device_options": {
      "accel_exponential": "float min=1.0 max=2.0",
      "accel_linear": "float min=0.01 max=100.00",
      "emulate_button_3": [
        "true",
        "false"
      ],
      "hand_mode": [
        "left",
        "right"
      ],
      "resolution": [
        "low",
        "medium-low",
        "medium-high",
        "high"
      ],
      "terminate_drift_threshold_pixels": "int min=0 max=1000",
      "virtual_scrolling": [
        "true",
        "false"
      ]
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

3.9.4. Read Device Options

The read_device_options action lists all the current settings for a given device. There is one required argument: "device":"<device_id>".

REST Request

PUT /sysadm/moused
{
   "device" : "psm0",
   "action" : "read_device_options"
}

WebSocket Request

{
   "name" : "moused",
   "id" : "fooid",
   "namespace" : "sysadm",
   "args" : {
      "action" : "read_device_options",
      "device" : "psm0"
   }
}

Response

{
  "args": {
    "read_device_options": {
      "accel_exponential": "1.0",
      "accel_linear": "1.0",
      "device": "psm0",
      "emulate_button_3": "false",
      "hand_mode": "right",
      "resolution": "medium-low",
      "terminate_drift_threshold_pixels": "0",
      "virtual_scrolling": "false"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

3.9.5. Set Device Active

The set_device_active action enables a device for use. The "device":"<device_id>" argument is required.

REST Request

PUT /sysadm/moused
{
   "device" : "ums0",
   "action" : "set_device_active"
}

WebSocket Request

{
   "args" : {
      "device" : "ums0",
      "action" : "set_device_active"
   },
   "namespace" : "sysadm",
   "name" : "moused",
   "id" : "fooid"
}

Response

{
  "args": {
    "set_device_active": {
      "started": "ums0"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

3.9.6. Set Device Inactive

The set_device_inactive action turns a specified mouse device off. The argument "device":"<device id>" is required.

REST Request

PUT /sysadm/moused
{
   "device" : "ums0",
   "action" : "set_device_inactive"
}

WebSocket Request

{
   "namespace" : "sysadm",
   "args" : {
      "action" : "set_device_inactive",
      "device" : "ums0"
   },
   "name" : "moused",
   "id" : "fooid"
}

Response

{
  "args": {
    "set_device_inactive": {
      "stopped": "ums0"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}

3.9.7. Set Device Options

The set_device_options action changes the options for a particular device. The argument "device":"<device_id>" is required, with at least one of the available options for device configuration. Including multiple options in a single API request is allowed as well.

REST Request

PUT /sysadm/moused
{
   "accel_exponential" : "1.5",
   "action" : "set_device_options",
   "device" : "psm0"
}

WebSocket Request

{
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "moused",
   "args" : {
      "accel_exponential" : "1.5",
      "device" : "psm0",
      "action" : "set_device_options"
   }
}

Response

{
  "args": {
    "set_device_options": {
      "accel_exponential": "1.5",
      "accel_linear": "1.0",
      "device": "psm0",
      "emulate_button_3": "false",
      "hand_mode": "right",
      "resolution": "medium-low",
      "terminate_drift_threshold_pixels": "0",
      "virtual_scrolling": "false"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}