2013-03-18 01:06:52 +04:00
#
2013-10-28 00:59:46 +04:00
# Copyright 2009, 2013 Red Hat, Inc.
2013-03-18 01:06:52 +04:00
#
2018-04-04 16:35:41 +03:00
# This work is licensed under the GNU GPLv2 or later.
2018-03-20 22:00:02 +03:00
# See the COPYING file in the top-level directory.
2013-03-18 01:06:52 +04:00
2018-03-20 19:18:35 +03:00
from . device import Device
2018-03-20 19:27:37 +03:00
from . . xmlbuilder import XMLProperty
2013-03-18 01:06:52 +04:00
2013-04-13 22:34:52 +04:00
2018-03-20 19:18:35 +03:00
class DeviceInput ( Device ) :
2018-03-21 17:53:34 +03:00
XML_NAME = " input "
2013-03-18 01:06:52 +04:00
2013-07-16 00:55:49 +04:00
TYPE_MOUSE = " mouse "
TYPE_TABLET = " tablet "
2015-04-09 20:22:40 +03:00
TYPE_KEYBOARD = " keyboard "
2021-07-27 21:21:46 +03:00
TYPE_EVDEV = " evdev "
2013-07-16 00:55:49 +04:00
BUS_PS2 = " ps2 "
BUS_USB = " usb "
2018-04-24 22:40:33 +03:00
BUS_VIRTIO = " virtio "
2013-07-16 00:55:49 +04:00
BUS_XEN = " xen "
2018-04-24 22:40:33 +03:00
2018-09-02 00:26:35 +03:00
type = XMLProperty ( " ./@type " )
bus = XMLProperty ( " ./@bus " )
2021-07-27 21:21:46 +03:00
model = XMLProperty ( " ./@model " )
source_evdev = XMLProperty ( " ./source/@evdev " )
source_dev = XMLProperty ( " ./source/@dev " )
source_repeat = XMLProperty ( " ./source/@repeat " , is_onoff = True )
source_grab = XMLProperty ( " ./source/@grab " )
source_grabToggle = XMLProperty ( " ./source/@grabToggle " )
2015-11-22 04:26:50 +03:00
2018-09-02 00:26:35 +03:00
##################
# Default config #
##################
def set_defaults ( self , guest ) :
if not self . type :
self . type = self . TYPE_MOUSE