Qtopia Core Pointer Handling
When running a Qtopia Core application, it either runs as a server or connects to an existing server. The mouse driver is loaded by the server application when it starts running, using Qt's plugin system. Internally in the client/server protocol, all system generated events, including pointer events, are passed to the server application which then propagates the event to the appropiate client. Note that pointer handling in Qtopia Core works for both mouse and mouse-like devices such as touch panels and trackballs. Contents: Available DriversQtopia Core provides ready-made drivers for the MouseMan, IntelliMouse, Microsoft, NEC Vr41XX, Linux Touch Panel and Yopy protocols as well as the universal touch screen library, tslib. Run the configure script to list the available drivers: ./configure -help In the default Qt configuration, only the "pc" mouse driver is enabled. The various drivers can be enabled and disabled using the configure script. For example: configure -qt-mouse-tslib Custom mouse drivers can be implemented by subclassing the QWSMouseHandler class and creating a mouse driver plugin (derived from the QMouseDriverPlugin class). Qtopia Core's implementation of the QMouseDriverFactory class will automatically detect the plugin, loading the driver into the server application at runtime. If you are creating a driver for a device that needs calibration or noise reduction, such as a touchscreen, derive from the QWSCalibratedMouseHandler subclass instead to take advantage of its calibration functionality. Specifying a DriverProvided that the "pc" mouse driver is enabled, Qtopia Core will try to auto-detect the mouse device if it is one of the supported types on /dev/psaux or one of the /dev/ttyS? serial lines. If multiple mice are detected, all may be used simultaneously. Note that Qtopia Core does not support auto-detection of touch panels in which case the driver must be specified explicitly to determine which device to use. To manually specify which driver to use, set the QWS_MOUSE_PROTO environment variable. For example (if the current shell is bash, ksh, zsh or sh): export QWS_MOUSE_PROTO=<driver>[:<driver specific options>] The valid values for the <driver> argument are MouseMan, IntelliMouse, Microsoft, VR41xx, LinuxTP, Yopy, Tslib and keys identifying custom drivers, and the driver specific options are typically a device, e.g., /dev/mouse for mouse devices and /dev/ts for touch panels. Multiple mouse drivers can be specified in one go: export QWS_MOUSE_PROTO="<driver>[:<driver specific options>] <driver>[:<driver specific options>] <driver>[:<driver specific options>]" Input will be read from all specified drivers. Note that the Vr41xx driver also accepts two optional arguments: press=<value> defining a mouse click (the default value is 750) and filter=<value> specifying the length of the filter used to eliminate noise (the default length is 3). For example: export QWS_MOUSE_PROTO="Vr41xx:press=500:/dev/misc/ts"
TroubleshootingDevice FilesMake sure you are using the correct device file. As a first step, you can test whether the device file actually gives any output. For instance, if you have specified the mouse driver with QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0} then try examining the output from the device by entering the following command in a console: cat /dev/input/mouse0 | hexdump If you see output from the device printed on the console when you move the mouse, you are probably using the correct device file; otherwise, you will need to experiment to find the correct device file. File PermissionsMake sure you have sufficient permissions to access the device file. The Qtopia Core server process needs at least read permission for the device file. Some drivers also require write access to the device file. For instance, if you have specified the mouse driver with QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0 then examine the permissions of the device file by entering the following command in a console: chmod a+rw /dev/input/mouse0 If the device file is actually a symbolic link to another file, you must change the permissions of the actual file instead.
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |