#
5125eae2 |
|
10-Nov-2008 |
Stephan Aßmus <superstippi@gmx.de> |
* Cleanup and refactoring, made several Mouse-/Keyboard-/TouchpadDevice functions private and moved them accordingly in the file. * I forgot to initialize the BObjectList to own the items in TouchpadInputDevice. * Changed the methods that read and apply settings in all three addons to be executed from the control threads only, which fixes race conditions. * The success of opening a device is no longer checked in the Start() method of the *Devices. Instead, the control thread checks the device before it enters the polling loop and cleans up if there was an error. This fixes non-running devices in the input_server because the PS/2 driver publishes devices which is has not checked yet for other reasons. It is important, however, to open() the devices in the Start() hook and not the control thread, otherwise there are unwanted race conditions in case node monitoring events are received more than once for the same device. That's the case for some reason on one of my computers for the AT 0 keyboard. TODO: * Combine the Touchpad and Mouse device addon into one, it's almost the same code except the Touchpad knows more settings and one more control message. * Refactor a common base class for Keyboard and Mouse device addon. * Fix the mouse speed/acceleration. If the speed is lowered from the default in the preflet, the mouse becomes almost unusable. To fix this, the same trick should be used as I used in the touchpad kernel driver, which is to sum up previous mouse moved fractional offsets. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28590 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
e01a0431 |
|
27-Oct-2008 |
Stephan Aßmus <superstippi@gmx.de> |
Sorry for the confusing patch... * Made KeyboardInputDevice more similar to MouseInputDevice, the object to track individual keyboards has become the class KeyboardDevice. Moved much functionality that used to be in KeyboardInputDevice into KeyboardDevice. Functionally, it should still be the same, but there are two important changes: - Each KeyboardDevice now has it's own Keymap. At first, it is not visible by the user, since all KeyboardDevices still adopt the keymap if the user reconfigures it. But it will make it easier to assign individual keymaps to each attached keyboard (and perhaps associate them with a vendor/product or some other means). The more immediate side effect is that there is no longer a confusion about the keyboard locks. If you press NumLock on your external keyboard, it will no longer enable NumLock on your notebooks internal keyboard. - KeyboardDevice now has a Stop() method, which it will call in it's destructor. This will make sure that the control thread is cleanly exited and does not end up invoking methods on a deleted object. * Rewrote the tracing implementation in MouseInputDevice.cpp. At least it helped track me down the following problem: * Both KeyboardDevice and MouseDevice now set fActive to "false" *before* closing the device. Since the control threads run at high priority, chances are high that rescheduling happens as soon as the device unblocks in ioctl() and returns an error. In that case, the control threads would check fActive and it would still be "true" and the whole idea of bailing out because we're already in Stop() would not work, causing a double free in the end. All of this is nice and more correct, but input_server is still crashing when restarting it via "input_server -q"... :-( git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28352 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c5555ad3 |
|
24-Oct-2008 |
Stephan Aßmus <superstippi@gmx.de> |
* Ignore B_ENTRY_REMOVED node monitor messages. * When the device watcher/control thread encounteres an error when read()ing or ioctl()ing the device, don't just quit the thread and leave a stale device add-on hanging there, but instead trigger _RemoveDevice() to exit this cleanly. This also takes care of calling _RemoveDevice() only from one thread. However, it adds a race condition should a mouse or keyboard be unplugged and plugged at the same time. I need to think about how to fix that cleanly, although the situation may be theoretical only... This fix seems to fix another problem with hot-plugging USB mice, before this change, the first mouse entry in /dev/input/mouse/usb/ was never gone and I got two entries after unplugging and replugging. * When using BObjectList configured to own the entries - don't delete the entries! Also don't call RemoveItem() before still using the item. Took me all day to find this one, because the code looked so... correct. :-} * In _AddDevice() call _RemoveDevice() just for the sake of it. It is really important that no device with the same name is published twice. The PS/2 driver behaves strange in that it publishes device more than once, if I understand correctly, until it decides that there is no device. * Only StartMonitoringDevice() /after/ having performed the initial device scan! Or else we may get ourselves confused. I don't know if this was an actual problem, but the code was like that before and it seems saner to me. Seeing there is no locking in the device add-on itself, we may already enter the code from the node monitor thread. This should fix #2894. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28321 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
b6a7b204 |
|
19-Oct-2008 |
Axel Dörfler <axeld@pinc-software.de> |
* Removed the log file stuff; debug output is now using debug_printf() instead. * Removed an inconsistency: both mouse and keyboad input device add-ons would scan /dev/input/keyboard respectively /dev/input/mouse when loaded, but then only monitor certain subdirectories from it. Now they monitor all. * Made KeyboardInputDevice::InitCheck() do what the name says, ie. nothing else. * Now uses BObjectList instead of BList, which also simplifies the code a bit. * Make use of the new BPathMonitor messages: as those contain a path, they greatly simplify their handling. * Cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28242 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
1ccc2f2d |
|
03-Sep-2008 |
Jérôme Duval <korli@users.berlios.de> |
fix debug build on Stop(), close the device, then wait for our service thread to quit git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27309 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
61604e48 |
|
15-Jun-2006 |
Axel Dörfler <axeld@pinc-software.de> |
I wanted to work on mouse acceleration, but this had to come first: * No longer calls _RecursiveScan() in InitCheck() (but in the constructor instead). * Fixed a bug when a new device was started: the new thread got a stack allocated structure pointer, but there were no handshake to make sure it was still valid. * Now checks all BMessage allocation, as well as adding fields for success, and doesn't enqueue partial messages. * Big refactoring and cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17845 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
23b47e0b |
|
14-Jun-2006 |
Jérôme Duval <korli@users.berlios.de> |
now remap mouse buttons if the mouse driver doesn't remap itself Remapping doesn't work on Haiku yet: it seems the mouse map isn't well updated for some unknown reason update license git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17843 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
4c0af4a8 |
|
17-Dec-2005 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Cleanup. Removed the weird SingletonMouseDevice git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15575 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c2fbfb71 |
|
05-Oct-2004 |
Jérôme Duval <korli@users.berlios.de> |
clean up, now avoid locking when shutdowning git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9208 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
fc2045ee |
|
26-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
added wheel support, changed to kb_mouse_driver.h mouse_movement to avoid crashing when the driver writes back the io git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9063 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
4c2a769c |
|
23-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
Now uses a global header git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9046 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
33efb919 |
|
06-Sep-2004 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Almost rewrote the mouse input add-on to handle multiple devices, added usb devices monitoring (not tested as USB doesn't work on my machine). Now it generates the device name from the folder name (i.e. /dev/input/mouse/serial/0 ---> "serial mouse 1"). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8860 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0dbc4bef |
|
03-Sep-2004 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Changed the fQuit variable to a static sQuit. Removed the snooze() in the device watcher thread function. Started implementing the "one thread per device" design. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8810 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
3aa69c78 |
|
02-Sep-2004 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Some changes to the Mouse Input Server Device add-on. B_MOUSE_UP/DOWN still don't work correctly git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8794 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
53d77642 |
|
01-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
Added mouse settings handling. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8779 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
61d7deee |
|
01-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
added a mouse input server device courtesy of Stefano Ceccherini basicly tested git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8766 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
5125eae25d9089bf2961a33d69ce26761150b0aa |
|
10-Nov-2008 |
Stephan Aßmus <superstippi@gmx.de> |
* Cleanup and refactoring, made several Mouse-/Keyboard-/TouchpadDevice functions private and moved them accordingly in the file. * I forgot to initialize the BObjectList to own the items in TouchpadInputDevice. * Changed the methods that read and apply settings in all three addons to be executed from the control threads only, which fixes race conditions. * The success of opening a device is no longer checked in the Start() method of the *Devices. Instead, the control thread checks the device before it enters the polling loop and cleans up if there was an error. This fixes non-running devices in the input_server because the PS/2 driver publishes devices which is has not checked yet for other reasons. It is important, however, to open() the devices in the Start() hook and not the control thread, otherwise there are unwanted race conditions in case node monitoring events are received more than once for the same device. That's the case for some reason on one of my computers for the AT 0 keyboard. TODO: * Combine the Touchpad and Mouse device addon into one, it's almost the same code except the Touchpad knows more settings and one more control message. * Refactor a common base class for Keyboard and Mouse device addon. * Fix the mouse speed/acceleration. If the speed is lowered from the default in the preflet, the mouse becomes almost unusable. To fix this, the same trick should be used as I used in the touchpad kernel driver, which is to sum up previous mouse moved fractional offsets. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28590 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
e01a04319073ac6a9b55cf2afb857d78a41aa2c8 |
|
27-Oct-2008 |
Stephan Aßmus <superstippi@gmx.de> |
Sorry for the confusing patch... * Made KeyboardInputDevice more similar to MouseInputDevice, the object to track individual keyboards has become the class KeyboardDevice. Moved much functionality that used to be in KeyboardInputDevice into KeyboardDevice. Functionally, it should still be the same, but there are two important changes: - Each KeyboardDevice now has it's own Keymap. At first, it is not visible by the user, since all KeyboardDevices still adopt the keymap if the user reconfigures it. But it will make it easier to assign individual keymaps to each attached keyboard (and perhaps associate them with a vendor/product or some other means). The more immediate side effect is that there is no longer a confusion about the keyboard locks. If you press NumLock on your external keyboard, it will no longer enable NumLock on your notebooks internal keyboard. - KeyboardDevice now has a Stop() method, which it will call in it's destructor. This will make sure that the control thread is cleanly exited and does not end up invoking methods on a deleted object. * Rewrote the tracing implementation in MouseInputDevice.cpp. At least it helped track me down the following problem: * Both KeyboardDevice and MouseDevice now set fActive to "false" *before* closing the device. Since the control threads run at high priority, chances are high that rescheduling happens as soon as the device unblocks in ioctl() and returns an error. In that case, the control threads would check fActive and it would still be "true" and the whole idea of bailing out because we're already in Stop() would not work, causing a double free in the end. All of this is nice and more correct, but input_server is still crashing when restarting it via "input_server -q"... :-( git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28352 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c5555ad3c04e295fccf9600cb0aa6eb45eadfbf5 |
|
24-Oct-2008 |
Stephan Aßmus <superstippi@gmx.de> |
* Ignore B_ENTRY_REMOVED node monitor messages. * When the device watcher/control thread encounteres an error when read()ing or ioctl()ing the device, don't just quit the thread and leave a stale device add-on hanging there, but instead trigger _RemoveDevice() to exit this cleanly. This also takes care of calling _RemoveDevice() only from one thread. However, it adds a race condition should a mouse or keyboard be unplugged and plugged at the same time. I need to think about how to fix that cleanly, although the situation may be theoretical only... This fix seems to fix another problem with hot-plugging USB mice, before this change, the first mouse entry in /dev/input/mouse/usb/ was never gone and I got two entries after unplugging and replugging. * When using BObjectList configured to own the entries - don't delete the entries! Also don't call RemoveItem() before still using the item. Took me all day to find this one, because the code looked so... correct. :-} * In _AddDevice() call _RemoveDevice() just for the sake of it. It is really important that no device with the same name is published twice. The PS/2 driver behaves strange in that it publishes device more than once, if I understand correctly, until it decides that there is no device. * Only StartMonitoringDevice() /after/ having performed the initial device scan! Or else we may get ourselves confused. I don't know if this was an actual problem, but the code was like that before and it seems saner to me. Seeing there is no locking in the device add-on itself, we may already enter the code from the node monitor thread. This should fix #2894. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28321 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
b6a7b20419195d04b1a157e45f745cf123d48a61 |
|
19-Oct-2008 |
Axel Dörfler <axeld@pinc-software.de> |
* Removed the log file stuff; debug output is now using debug_printf() instead. * Removed an inconsistency: both mouse and keyboad input device add-ons would scan /dev/input/keyboard respectively /dev/input/mouse when loaded, but then only monitor certain subdirectories from it. Now they monitor all. * Made KeyboardInputDevice::InitCheck() do what the name says, ie. nothing else. * Now uses BObjectList instead of BList, which also simplifies the code a bit. * Make use of the new BPathMonitor messages: as those contain a path, they greatly simplify their handling. * Cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28242 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
1ccc2f2d7b70f716db7d12fefc2ef16fe0e7fb00 |
|
03-Sep-2008 |
Jérôme Duval <korli@users.berlios.de> |
fix debug build on Stop(), close the device, then wait for our service thread to quit git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27309 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
61604e487540ca4fe90f8d47e309e5b698bf23d0 |
|
15-Jun-2006 |
Axel Dörfler <axeld@pinc-software.de> |
I wanted to work on mouse acceleration, but this had to come first: * No longer calls _RecursiveScan() in InitCheck() (but in the constructor instead). * Fixed a bug when a new device was started: the new thread got a stack allocated structure pointer, but there were no handshake to make sure it was still valid. * Now checks all BMessage allocation, as well as adding fields for success, and doesn't enqueue partial messages. * Big refactoring and cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17845 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
23b47e0b5e13933d497a70b2274e5623ca7d0910 |
|
14-Jun-2006 |
Jérôme Duval <korli@users.berlios.de> |
now remap mouse buttons if the mouse driver doesn't remap itself Remapping doesn't work on Haiku yet: it seems the mouse map isn't well updated for some unknown reason update license git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17843 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
4c0af4a82e555ed369edf65056ebc537a49248aa |
|
17-Dec-2005 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Cleanup. Removed the weird SingletonMouseDevice git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15575 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c2fbfb71f0f3834b2d53b1a98c75ea6672cb36d0 |
|
05-Oct-2004 |
Jérôme Duval <korli@users.berlios.de> |
clean up, now avoid locking when shutdowning git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9208 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
fc2045ee7eceb042beb790a6c23f0a8a2e001492 |
|
26-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
added wheel support, changed to kb_mouse_driver.h mouse_movement to avoid crashing when the driver writes back the io git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9063 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
4c2a769c68e3290d544d2ee1ddbc61ca645bfd59 |
|
23-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
Now uses a global header git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9046 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
33efb919153cc2b04a507abfea8862758d2b3d72 |
|
06-Sep-2004 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Almost rewrote the mouse input add-on to handle multiple devices, added usb devices monitoring (not tested as USB doesn't work on my machine). Now it generates the device name from the folder name (i.e. /dev/input/mouse/serial/0 ---> "serial mouse 1"). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8860 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0dbc4bef4976e237dfc3ff3e3116582020e3d129 |
|
03-Sep-2004 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Changed the fQuit variable to a static sQuit. Removed the snooze() in the device watcher thread function. Started implementing the "one thread per device" design. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8810 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
3aa69c787fc9dd5fcf1a08e3e05f89fe616a53ec |
|
02-Sep-2004 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Some changes to the Mouse Input Server Device add-on. B_MOUSE_UP/DOWN still don't work correctly git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8794 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
53d77642d6390cbbd784872b12396ea863e990d8 |
|
01-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
Added mouse settings handling. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8779 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
61d7deee8a1d9a8cf88e96d3acd0be2c79234a62 |
|
01-Sep-2004 |
Jérôme Duval <korli@users.berlios.de> |
added a mouse input server device courtesy of Stefano Ceccherini basicly tested git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8766 a95241bf-73f2-0310-859d-f6bbb57e9c96
|