of their machine: if the password check is turned on, and the password window
is shown but times out (when the screen saver starts again after the standard
delay), the input filter never knew about this and would never try to end the
screen saver again.
The solution is to take the logic for turning off the screen saver out of the
input filter and put it in the screen blanker itself.
Also while working in the input filter I removed some debugging and a TODO that
I think cannot be fixed.
In the screen_blanker the exit after loading the settings file was removed
since the default settings now work for the screen_blanker.
Plus obviously code was added to handle exit upon user input as well as the
timing out of the password window.
If anyone has a better solution for the 250ms timeout to ignore initial mouse
moves, let me know.
Also I think the new calls should be nothrow, but I am not sure what the rule
is for that.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29488 a95241bf-73f2-0310-859d-f6bbb57e9c96
the better idea after all. The snoozing won't add an additional delay, if the
polling was already slow. Have not tested in VMWare myself, as I don't have a
working installation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29436 a95241bf-73f2-0310-859d-f6bbb57e9c96
fixes the high CPU usage when using USB mice. I experimented with transfers
scheduled at fixed intervals, and with using a fixed pause between transfers.
The fixed pauses, though much less sophisticated, give the smoothest drawing
in WonderBrush. ;-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29413 a95241bf-73f2-0310-859d-f6bbb57e9c96
build. I sure hope that this doesn't break the build for anyone else.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28992 a95241bf-73f2-0310-859d-f6bbb57e9c96
values. The implementation needs to sum up fractional movement, not
truncate to zero. Before this change, the mouse would be pretty much unusable
at lower speeds/acceleration. Now it is guaranteed to move.
* No need to memset() before ioctl(), the driver does that anyways.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28669 a95241bf-73f2-0310-859d-f6bbb57e9c96
code duplication and will make maintaining it much easier.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28647 a95241bf-73f2-0310-859d-f6bbb57e9c96
won't be called, the control thread will remove the device anyways.
* Turned off the debug output I left on accidentally in KeyboardInputDevice.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28642 a95241bf-73f2-0310-859d-f6bbb57e9c96
sure that you can have an old style mouse without scroll wheel and one with attached at the
same time. For example, when I hot-plug my PS/2 mouse with wheel, the IBM trackpoint will
otherwise already use up the "PS/2 Mouse 1" name.
Unfortunately, hot-plugging the PS/2 mouse on my T60 docking station still does not work
quite right. The PS/2 driver detects everything correctly, the node monitoring works and I end
up with the correct device threads in the input_server. (The notebook is automatically removing
the touchpad and trackpoint devices in this event, which cannot be turned off in the BIOS.)
However, the mouse does not move. In the syslog, I see one message
"ps2: strange mouse data, x/y overflow, trying resync" after the the output from the add-on
manager in the input_server that it has added the new device. When I restart the input_server,
it works fine, even though the same devices are detected and polling threads are running.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28591 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
worked, because the root scanning directory was declared without "/dev/".
This makes restarting the input_server work with the touchpad driver.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28464 a95241bf-73f2-0310-859d-f6bbb57e9c96
solution and replaced it by dumping output to the syslog. (Also
disabled debug output by default.)
* Fixed wrong header guard.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28463 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Applied the changes that were done to MouseInputDevice:
- use BObjectList,
- take adventage of BPathMonitor node monitor message fieds
- remove the device in the polling thread upon ioctl() error
* Added TODOs about refactoring the code together with MouseInputDevice.
Untested, but the code is so similar, I am pretty confident it still works.
(famous last words... will test soon anyways)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28421 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added myself to Mouse and Keyboard add-ons for my recent work on them.
* Small cleanup in KeyboardInputDevice.h-
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28420 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Implemented Synaptics touchpad support in the PS2 bus_manager by
refactoring/splitting the structure some and adding touchpad device
handling.
* Implemented Touchpad input_server device add-on
* Created Touchpad preflet for configuring advances Synaptics touchpad
options like scroll region (both horizontal and vertical) as well
as other neat stuff
Thanks a lot, Clemens!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28416 a95241bf-73f2-0310-859d-f6bbb57e9c96
* 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
resulted in the keyboard not working (at least on my Lenovo/IBM T60).
The device control thread could become aware of a dead device
at the time another thread (for example the add-on manager thread)
is already waiting for it. Then it tried to remove the device and
got stuck on locks that the other thread already holds (InputDeviceItem
list lock). Now the control threads check the "active" flag before
trying to remove the devices themselves, which, when set, is a sure
sign that the devices are already being removed and they don't need
to take care of it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28342 a95241bf-73f2-0310-859d-f6bbb57e9c96
* 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
devices that were removed. Should use the BPathMonitor anyways...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28315 a95241bf-73f2-0310-859d-f6bbb57e9c96
ctrl-alt-del pressed for 4 seconds, the system will reboot.
* Not sure if this makes any sense, though, as the button can be selected via
the keyboard as well (in BeOS, the reboot is triggered in the device, so it
will also work if the input_server hangs).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28260 a95241bf-73f2-0310-859d-f6bbb57e9c96
* This is actually a work in progress, but the functionality of the former
version should be preserved.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28259 a95241bf-73f2-0310-859d-f6bbb57e9c96
* 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
it works well with its controlling looper. This fixes#2638.
* Header cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27885 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
- fix warning.
Note T9 could still be of use on the desktop, for ex by disabled people with enough mobility to access a numeric keypad...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25998 a95241bf-73f2-0310-859d-f6bbb57e9c96
to contain headers shared by kernel and userland (mainly libroot).
* Moved quite a few private kernel headers to the new location. Split
several kernel headers into a shared part and one that is still kernel
private. Adjusted all affected Jamfiles and source in the standard x86
build accordingly. The build for other architectures and for test code
may be broken.
* Quite a bit of userland code still includes private kernel headers.
Mostly those are <util/*> headers. The ones that aren't strictly
kernel-only should be moved to some other place (maybe
headers/private/shared/util).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
from the input_server implementation to create a log file.
* DeviceReader already provided the data byte count, since this is a USB
only Wacom driver, we can simply use the max_packet_size from the endpoint
descriptor. Changed TabledDevice accordingly to use the already existing
DeviceReader::MaxPacketSize().
* Reworked DeviceReader::ReadData(). Renamed variables for clarity and
removed the restriction to read exactly the requested ammount of bytes,
reading more than the "header" (which contains vendor id, product id
and max packet size) is already considered a successful read.
* Refactored TabledDevice::poll_usb_device().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24018 a95241bf-73f2-0310-859d-f6bbb57e9c96
* the structure of the add-on was originally designed to handle all kinds of
different input devices, but has been limited to handle Wacom tablets for
now, since our mouse add-on handles the rest already.
* various Wacom Tablets are supported including Cintiq Partner, Graphire,
Graphire2/3/4, Intuos, Intous2/3, PenStation, PenPartner and Volito
TODO: Currently, the add-on does not work for some reason, though the kernel
driver publishes a devfs entry and the input_server picks it up, the Wacom
device thread is running. Need to investigate...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23667 a95241bf-73f2-0310-859d-f6bbb57e9c96
B_MOUSE_MOVED message does not already contain the same buttons as a
following B_MOUSE_DOWN message... fixes mouse clicks being ignored
when you are moving the mouse at the same time when clicking
(using Haiku's mouse input_server device on BeOS or ZETA)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23421 a95241bf-73f2-0310-859d-f6bbb57e9c96
now checks if the fOwner allocation went fine (and returns B_NO_MEMORY
in case it didn't). Since it can fail, inherited classes should call it
as well (I modified MouseInputDevice's and KeyboardInputDevice's
versions for now)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23106 a95241bf-73f2-0310-859d-f6bbb57e9c96
node monitoring requires the node directory to exist
this fixes PS2 keyboard node monitoring when unpublishing/publishing
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20916 a95241bf-73f2-0310-859d-f6bbb57e9c96
shuffled "isExecutable" to the end. The new order favors the common use
cases. Adjusted all Addon invocations and while at it also removed
separate LinkAgainst invocations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20604 a95241bf-73f2-0310-859d-f6bbb57e9c96
by _Banish() (never happened before).
* Instead of sending a new message for every mouse move in a corner, we now keep
one BMessageRunner around and only update its interval; we now also check the
time with no events in CheckCornerInvoke() - this both makes sure that the screen
is not blanked while there is still user activity.
* The screen saver never worked if you didn't set the never-blank corner to something.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19699 a95241bf-73f2-0310-859d-f6bbb57e9c96
commits seem to work fine (BTW, what an odd place for the TeamMonitor :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19314 a95241bf-73f2-0310-859d-f6bbb57e9c96
the input method aware view.
This was necessary to support stopping an input method on the fly: if you press
the dead key first, then change to another view and press a key that is changed
by the dead key, the resulting key now reaches its target, and will no longer
be ignored.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19119 a95241bf-73f2-0310-859d-f6bbb57e9c96
for dead keys - IOW you'll now see dead keys in BTextViews as you would see real
input methods like canna. Non-input-method-aware views won't see a difference to
the previous behaviour, though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19117 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Scancodes greater 255 are now handled correctly, and will no longer crash
the input_server. This fixes bug #830.
* Use new (std:nothrow) instead of a simple new
* Now checks all allocations and appropriately handle failure
* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18694 a95241bf-73f2-0310-859d-f6bbb57e9c96
acceleration factor is 1 which wasn't the case before.
The defaults now feel pretty good over here.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17884 a95241bf-73f2-0310-859d-f6bbb57e9c96
may differ), but I think it's definitely an improvement. This fixes bug #402.
* Since there now is acceleration, I reduced the mouse speed by half.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17850 a95241bf-73f2-0310-859d-f6bbb57e9c96
* 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
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
* simplified drawing a bit, and got rid of those scary scale*() stuff (which also
results in better looks). The monitor now looks like the one in Screen; I think
it should either be a very reduced form or a very detailed form, but anything
in between often looks just odd.
* It now also listens to B_MOUSE_DOWN incl. mouse tracking, not only to B_MOUSE_UP.
* Less flickering on state changes (and focus change).
* Loading settings no longer overwrites defaults missing from the settings.
* Renamed ScreenSaverSettings::GetBlankCorner() to BlankCorner(),
LoadSettings() to Load(), GetState() to GetModuleState(), ....
* Some more cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17783 a95241bf-73f2-0310-859d-f6bbb57e9c96
all, so it should be used like one.
* Fixed a memory leak because of incorrect BMessageRunner usage.
* Some corner rects were computed incorrectly (I did that earlier).
* Since either a file or a directory is watched, but never both at the same
time, we only need to store one ref.
* Don't update the settings as long as there is no settings file.
* Fixed strange usage of watch_node() - not specifying a handler means that
the message is sent to the preferred handler, a BLooper is also always a
handler, and the message only should go there.
* Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17773 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed lots of things, like ScreenSaverThread to ScreenSaverRunner,
refactored code, etc. Much cleaner interfaces and code.
* Fixed a couple of bugs and in the add-on handling, especially some settings
related bugs (ie. testing a screen saver will now use its latest settings,
etc.).
* Correctly implemented DPMS support in ScreenSaverPrefs and the ScreenSaver
preferences application - screen_blanker still ignores them, though.
* It's not yet font sensitive either.
* Changed the input_server add-on to not switch to the screen blanker immediately
when it's in the "blank corner" - doesn't seem to work yet, though (only tested
under Qemu).
* Correctly implemented the "preview" function (before, a screen saver would
never know it rendered a preview).
* Evaluates the return value of BScreenSaver::StartSaver().
* The screen saver thread is no longer killed without notice - it's now
always shut down properly.
* Made the code more robust against failure.
* Introduced some new bugs as well (the screen saver list view doesn't jump to
the selection anymore, for some reason), those will be fixed later (as the
remaining issues).
* Probably some more I forgot about.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17731 a95241bf-73f2-0310-859d-f6bbb57e9c96
also assigning the window field to null when quitting the window
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17128 a95241bf-73f2-0310-859d-f6bbb57e9c96
- made 'active' variable volatile
Bugfixes:
- fixed deletion of mouse_device from fDevices list when the object is deleted.
- removed deadlock from RemoveDevice
- call UnregisterDevice from inside RemoveDevice
- terminate devicer watcher thread on read error
- skip "serial" directory always
- close file handle when initializing device watcher thread fails
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16927 a95241bf-73f2-0310-859d-f6bbb57e9c96
- keyboard_device now frees device_ref.name by itself when it's deleted
- made 'active' variable volatile
Bugfixes:
- delete keyboard_device from fDevices list when the object is deleted.
- removed deadlock from RemoveDevice
- call UnregisterDevice from inside RemoveDevice
- terminate devicer watcher thread on read error
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16926 a95241bf-73f2-0310-859d-f6bbb57e9c96