|
Lines 132-144
void LogitechMouse::updateCordlessStatus()
Link Here
|
| 132 |
{ |
132 |
{ |
| 133 |
TQByteArray status(8); |
133 |
TQByteArray status(8); |
| 134 |
|
134 |
|
| 135 |
int result = usb_control_msg( m_usbDeviceHandle, |
135 |
int result = (m_usbDeviceHandle != 0 |
|
|
136 |
? usb_control_msg( m_usbDeviceHandle, |
| 136 |
USB_TYPE_VENDOR | USB_ENDPOINT_IN,0x09, |
137 |
USB_TYPE_VENDOR | USB_ENDPOINT_IN,0x09, |
| 137 |
(0x0003 | m_useSecondChannel), |
138 |
(0x0003 | m_useSecondChannel), |
| 138 |
(0x0000 | m_useSecondChannel), |
139 |
(0x0000 | m_useSecondChannel), |
| 139 |
status.data(), |
140 |
status.data(), |
| 140 |
0x0008, |
141 |
0x0008, |
| 141 |
1000); |
142 |
1000) |
|
|
143 |
: -1); |
| 142 |
|
144 |
|
| 143 |
if (0 > result) { |
145 |
if (0 > result) { |
| 144 |
// We probably have a permission problem |
146 |
// We probably have a permission problem |
|
Lines 253-266
void LogitechMouse::updateResolution()
Link Here
|
| 253 |
{ |
255 |
{ |
| 254 |
char resolution; |
256 |
char resolution; |
| 255 |
|
257 |
|
| 256 |
int result = usb_control_msg( m_usbDeviceHandle, |
258 |
int result = (m_usbDeviceHandle != 0 |
|
|
259 |
? usb_control_msg( m_usbDeviceHandle, |
| 257 |
USB_TYPE_VENDOR | USB_ENDPOINT_IN, |
260 |
USB_TYPE_VENDOR | USB_ENDPOINT_IN, |
| 258 |
0x01, |
261 |
0x01, |
| 259 |
0x000E, |
262 |
0x000E, |
| 260 |
0x0000, |
263 |
0x0000, |
| 261 |
&resolution, |
264 |
&resolution, |
| 262 |
0x0001, |
265 |
0x0001, |
| 263 |
100); |
266 |
100) |
|
|
267 |
: -1); |
| 264 |
|
268 |
|
| 265 |
// kdDebug() << "resolution is: " << resolution << endl; |
269 |
// kdDebug() << "resolution is: " << resolution << endl; |
| 266 |
if (0 > result) { |
270 |
if (0 > result) { |
|
Lines 273-286
void LogitechMouse::updateResolution()
Link Here
|
| 273 |
|
277 |
|
| 274 |
void LogitechMouse::setLogitechTo800() |
278 |
void LogitechMouse::setLogitechTo800() |
| 275 |
{ |
279 |
{ |
| 276 |
int result = usb_control_msg( m_usbDeviceHandle, |
280 |
int result = (m_usbDeviceHandle != 0 |
|
|
281 |
? usb_control_msg( m_usbDeviceHandle, |
| 277 |
USB_TYPE_VENDOR, |
282 |
USB_TYPE_VENDOR, |
| 278 |
0x02, |
283 |
0x02, |
| 279 |
0x000E, |
284 |
0x000E, |
| 280 |
4, |
285 |
4, |
| 281 |
NULL, |
286 |
NULL, |
| 282 |
0x0000, |
287 |
0x0000, |
| 283 |
100); |
288 |
100) |
|
|
289 |
: -1); |
| 284 |
if (0 > result) { |
290 |
if (0 > result) { |
| 285 |
kdWarning() << "Error setting resolution on device: " << usb_strerror() << endl; |
291 |
kdWarning() << "Error setting resolution on device: " << usb_strerror() << endl; |
| 286 |
} |
292 |
} |
|
Lines 288-301
void LogitechMouse::setLogitechTo800()
Link Here
|
| 288 |
|
294 |
|
| 289 |
void LogitechMouse::setLogitechTo400() |
295 |
void LogitechMouse::setLogitechTo400() |
| 290 |
{ |
296 |
{ |
| 291 |
int result = usb_control_msg( m_usbDeviceHandle, |
297 |
int result = (m_usbDeviceHandle != 0 |
|
|
298 |
? usb_control_msg( m_usbDeviceHandle, |
| 292 |
USB_TYPE_VENDOR, |
299 |
USB_TYPE_VENDOR, |
| 293 |
0x02, |
300 |
0x02, |
| 294 |
0x000E, |
301 |
0x000E, |
| 295 |
3, |
302 |
3, |
| 296 |
NULL, |
303 |
NULL, |
| 297 |
0x0000, |
304 |
0x0000, |
| 298 |
100); |
305 |
100) |
|
|
306 |
: -1); |
| 299 |
if (0 > result) { |
307 |
if (0 > result) { |
| 300 |
kdWarning() << "Error setting resolution on device: " << usb_strerror() << endl; |
308 |
kdWarning() << "Error setting resolution on device: " << usb_strerror() << endl; |
| 301 |
} |
309 |
} |
|
Lines 319-332
bool LogitechMouse::isDualChannelCapable()
Link Here
|
| 319 |
|
327 |
|
| 320 |
void LogitechMouse::setChannel1() |
328 |
void LogitechMouse::setChannel1() |
| 321 |
{ |
329 |
{ |
| 322 |
int result = usb_control_msg( m_usbDeviceHandle, |
330 |
int result = (m_usbDeviceHandle != 0 |
|
|
331 |
? usb_control_msg( m_usbDeviceHandle, |
| 323 |
USB_TYPE_VENDOR, |
332 |
USB_TYPE_VENDOR, |
| 324 |
0x02, |
333 |
0x02, |
| 325 |
(0x0008 | m_useSecondChannel), |
334 |
(0x0008 | m_useSecondChannel), |
| 326 |
(0x0000 | m_useSecondChannel), |
335 |
(0x0000 | m_useSecondChannel), |
| 327 |
NULL, |
336 |
NULL, |
| 328 |
0x0000, |
337 |
0x0000, |
| 329 |
1000); |
338 |
1000) |
|
|
339 |
: -1); |
| 330 |
|
340 |
|
| 331 |
if (0 > result) { |
341 |
if (0 > result) { |
| 332 |
kdWarning() << "Error setting mouse to channel 1 : " << usb_strerror() << endl; |
342 |
kdWarning() << "Error setting mouse to channel 1 : " << usb_strerror() << endl; |
|
Lines 336-349
void LogitechMouse::setChannel1()
Link Here
|
| 336 |
|
346 |
|
| 337 |
void LogitechMouse::setChannel2() |
347 |
void LogitechMouse::setChannel2() |
| 338 |
{ |
348 |
{ |
| 339 |
int result = usb_control_msg( m_usbDeviceHandle, |
349 |
int result = (m_usbDeviceHandle != 0 |
|
|
350 |
? usb_control_msg( m_usbDeviceHandle, |
| 340 |
USB_TYPE_VENDOR, |
351 |
USB_TYPE_VENDOR, |
| 341 |
0x02, |
352 |
0x02, |
| 342 |
(0x0008 | m_useSecondChannel), |
353 |
(0x0008 | m_useSecondChannel), |
| 343 |
(0x0001 | m_useSecondChannel), |
354 |
(0x0001 | m_useSecondChannel), |
| 344 |
NULL, |
355 |
NULL, |
| 345 |
0x0000, |
356 |
0x0000, |
| 346 |
1000); |
357 |
1000) |
|
|
358 |
: -1); |
| 347 |
|
359 |
|
| 348 |
if (0 > result) { |
360 |
if (0 > result) { |
| 349 |
kdWarning() << "Error setting mouse to channel 2 : " << usb_strerror() << endl; |
361 |
kdWarning() << "Error setting mouse to channel 2 : " << usb_strerror() << endl; |