* Removed the pretty useless "Multifinger scrolling" option - it's now always

the same as the two finger scrolling option (could be disabled, too, opinions
  welcome).
* Added a new settings to disable horizontal two finger scrolling, since it's
  not that easy to only scroll in one direction with this. Maybe a higher
  starting boundary would also be an option for this instead, Clemens what do
  you think?
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33468 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-10-06 14:30:57 +00:00
parent a75c97c3ad
commit fc548b41f3
6 changed files with 37 additions and 26 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2008, Haiku, Inc. All Rights Reserved.
* Copyright 2001-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef TOUCHPAD_SETTINGS_H
@@ -10,7 +10,7 @@
typedef struct {
bool scroll_twofinger;
bool scroll_multifinger;
bool scroll_twofinger_horizontal;
float scroll_rightrange; // from 0 to 1
float scroll_bottomrange; // from 0 to 1
uint16 scroll_xstepsize;
@@ -549,8 +549,8 @@ status_t
MouseDevice::_ReadTouchpadSettingsMsg(BMessage* message)
{
message->FindBool("scroll_twofinger", &fTouchpadSettings.scroll_twofinger);
message->FindBool("scroll_multifinger",
&fTouchpadSettings.scroll_multifinger);
message->FindBool("scroll_twofinger_horizontal",
&fTouchpadSettings.scroll_twofinger_horizontal);
message->FindFloat("scroll_rightrange",
&fTouchpadSettings.scroll_rightrange);
message->FindFloat("scroll_bottomrange",
@@ -246,13 +246,18 @@ touchevent_to_movement(synaptics_cookie* cookie, touch_event *event,
|| settings->scroll_bottomrange > 0.999999) {
isSideScrollingH = true;
}
if (isSideScrollingV || isSideScrollingH
|| (event->wValue == 0 && settings->scroll_twofinger)
|| (event->wValue == 1 && settings->scroll_multifinger)) {
goto scrolling;
} else {
cookie->scrolling_started = false;
if ((event->wValue == 0 || event->wValue == 1)
&& settings->scroll_twofinger) {
// two finger scrolling is enabled
isSideScrollingV = true;
isSideScrollingH = settings->scroll_twofinger_horizontal;
}
if (isSideScrollingV || isSideScrollingH)
goto scrolling;
else
cookie->scrolling_started = false;
goto movement;
} else {
goto notouch;
+2 -1
View File
@@ -59,7 +59,8 @@ TouchpadPref::UpdateSettings()
BMessage msg;
msg.AddBool("scroll_twofinger", fSettings.scroll_twofinger);
msg.AddBool("scroll_multifinger", fSettings.scroll_multifinger);
msg.AddBool("scroll_twofinger_horizontal",
fSettings.scroll_twofinger_horizontal);
msg.AddFloat("scroll_rightrange", fSettings.scroll_rightrange);
msg.AddFloat("scroll_bottomrange", fSettings.scroll_bottomrange);
msg.AddInt16("scroll_xstepsize", fSettings.scroll_xstepsize);
+19 -14
View File
@@ -8,25 +8,25 @@
#include "TouchpadPrefView.h"
#include "kb_mouse_driver.h"
#include <CheckBox.h>
#include <stdio.h>
#include <Alert.h>
#include <Box.h>
#include <CheckBox.h>
#include <File.h>
#include <FindDirectory.h>
#include <GroupLayout.h>
#include <GroupView.h>
#include <Input.h>
#include <SpaceLayoutItem.h>
#include <LayoutBuilder.h>
#include <MenuField.h>
#include <MenuItem.h>
#include <Message.h>
#include <Path.h>
#include <Screen.h>
#include <SpaceLayoutItem.h>
#include <Window.h>
#include <stdio.h>
#include "kb_mouse_driver.h"
const uint32 SCROLL_X_DRAG = 'sxdr';
@@ -283,12 +283,13 @@ TouchpadPrefView::MessageReceived(BMessage* msg)
break;
case SCROLL_CONTROL_CHANGED:
settings.scroll_twofinger = fTwoFingerBox->Value() == B_CONTROL_ON;
settings.scroll_multifinger
= fMultiFingerBox->Value() == B_CONTROL_ON;
settings.scroll_twofinger_horizontal
= fTwoFingerHorizontalBox->Value() == B_CONTROL_ON;
settings.scroll_acceleration = fScrollAccelSlider->Value();
settings.scroll_xstepsize = (20 - fScrollStepXSlider->Value()) * 3;
settings.scroll_ystepsize = (20 - fScrollStepYSlider->Value()) * 3;
fRevertButton->SetEnabled(true);
fTwoFingerHorizontalBox->SetEnabled(settings.scroll_twofinger);
fTouchpadPref.UpdateSettings();
break;
case TAP_CONTROL_CHANGED:
@@ -320,7 +321,7 @@ TouchpadPrefView::AttachedToWindow()
{
fTouchpadView->SetTarget(this);
fTwoFingerBox->SetTarget(this);
fMultiFingerBox->SetTarget(this);
fTwoFingerHorizontalBox->SetTarget(this);
fScrollStepXSlider->SetTarget(this);
fScrollStepYSlider->SetTarget(this);
fScrollAccelSlider->SetTarget(this);
@@ -382,13 +383,16 @@ TouchpadPrefView::SetupView()
fTwoFingerBox = new BCheckBox("Two Finger Scrolling",
new BMessage(SCROLL_CONTROL_CHANGED));
fMultiFingerBox = new BCheckBox("Multi Finger Scrolling",
fTwoFingerHorizontalBox = new BCheckBox("Horizontal Scrolling",
new BMessage(SCROLL_CONTROL_CHANGED));
BGroupView* scrollPrefLeftLayout = new BGroupView(B_VERTICAL);
scrollPrefLeftLayout->AddChild(fTouchpadView);
scrollPrefLeftLayout->AddChild(fTwoFingerBox);
scrollPrefLeftLayout->AddChild(fMultiFingerBox);
BLayoutBuilder::Group<>(scrollPrefLeftLayout)
.Add(fTouchpadView)
.Add(fTwoFingerBox)
.AddGroup(B_HORIZONTAL)
.AddStrut(20)
.Add(fTwoFingerHorizontalBox);
BGroupView* scrollPrefRightLayout = new BGroupView(B_VERTICAL);
scrollPrefRightLayout->AddChild(fScrollAccelSlider);
@@ -452,8 +456,9 @@ TouchpadPrefView::SetValues(touchpad_settings* settings)
settings->scroll_bottomrange);
fTwoFingerBox->SetValue(settings->scroll_twofinger
? B_CONTROL_ON : B_CONTROL_OFF);
fMultiFingerBox->SetValue(settings->scroll_multifinger
fTwoFingerHorizontalBox->SetValue(settings->scroll_twofinger_horizontal
? B_CONTROL_ON : B_CONTROL_OFF);
fTwoFingerHorizontalBox->SetEnabled(settings->scroll_twofinger);
fScrollStepXSlider->SetValue(20 - settings->scroll_xstepsize / 2);
fScrollStepYSlider->SetValue(20 - settings->scroll_ystepsize / 2);
fScrollAccelSlider->SetValue(settings->scroll_acceleration);
+1 -1
View File
@@ -92,7 +92,7 @@ public:
private:
TouchpadView* fTouchpadView;
BCheckBox* fTwoFingerBox;
BCheckBox* fMultiFingerBox;
BCheckBox* fTwoFingerHorizontalBox;
BSlider* fScrollStepXSlider;
BSlider* fScrollStepYSlider;
BSlider* fScrollAccelSlider;