Input: declare BString to get the Mouse Name
Change-Id: I3476f58839202a6fd8c93e325a15045963a9b7b2 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3125 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
37d793236c
commit
02ad22d6c8
@@ -350,3 +350,65 @@
|
|||||||
|
|
||||||
\since BeOS R3
|
\since BeOS R3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t get_mouse_type(int32* type)
|
||||||
|
\brief Get the number of buttons of the mouse.
|
||||||
|
|
||||||
|
If there are multiple mouses connected, the number of buttons for one of
|
||||||
|
them picked at random will be returned.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t set_mouse_type(int32 type)
|
||||||
|
\brief Set the number of buttons of the mouse.
|
||||||
|
\deprecated use set_mouse_type_by_name instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t get_mouse_type_by_name(BString mouse_name, int32* type)
|
||||||
|
\brief Get the number of buttons for a specific mouse.
|
||||||
|
|
||||||
|
Mouse names can be known from BInputDevice.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t set_mouse_type_by_name(BString mouse_name, int32* type)
|
||||||
|
\brief Configure the number of buttons for a specific mouse.
|
||||||
|
|
||||||
|
The setting is saved and persists accross reboots.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t get_mouse_speed(int32* speed)
|
||||||
|
\brief Get the mouse speed
|
||||||
|
|
||||||
|
If there are multiple mouses connected, this function return the speed
|
||||||
|
from a random one.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t set_mouse_speed(int32 speed)
|
||||||
|
\brief Set the mouse speed
|
||||||
|
\deprecated use set_mouse_speed_by_name instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t get_mouse_speed_by_name(BString mouse_name, int32* speed)
|
||||||
|
\brief Get the mouse speed setting for a specific mouse
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t set_mouse_speed_by_name(BString mouse_name, int32 speed)
|
||||||
|
\brief Set the mouse speed for a specific mouse.
|
||||||
|
|
||||||
|
The setting is saved and persists accross reboots.
|
||||||
|
*/
|
||||||
|
|||||||
@@ -428,6 +428,8 @@ status_t get_click_speed(bigtime_t* speed);
|
|||||||
status_t set_click_speed(bigtime_t speed);
|
status_t set_click_speed(bigtime_t speed);
|
||||||
status_t get_mouse_speed(int32* speed);
|
status_t get_mouse_speed(int32* speed);
|
||||||
status_t set_mouse_speed(int32 speed);
|
status_t set_mouse_speed(int32 speed);
|
||||||
|
status_t get_mouse_speed_by_name(BString mouse_name, int32* speed);
|
||||||
|
status_t set_mouse_speed_by_name(BString mouse_name, int32 speed);
|
||||||
status_t get_mouse_acceleration(int32* speed);
|
status_t get_mouse_acceleration(int32* speed);
|
||||||
status_t set_mouse_acceleration(int32 speed);
|
status_t set_mouse_acceleration(int32 speed);
|
||||||
|
|
||||||
|
|||||||
@@ -515,7 +515,6 @@ void
|
|||||||
MouseDevice::_UpdateSettings()
|
MouseDevice::_UpdateSettings()
|
||||||
{
|
{
|
||||||
MD_CALLED();
|
MD_CALLED();
|
||||||
|
|
||||||
// retrieve current values
|
// retrieve current values
|
||||||
|
|
||||||
if (get_mouse_map(&fSettings.map) != B_OK)
|
if (get_mouse_map(&fSettings.map) != B_OK)
|
||||||
@@ -530,7 +529,7 @@ MouseDevice::_UpdateSettings()
|
|||||||
else
|
else
|
||||||
ioctl(fDevice, MS_SET_CLICKSPEED, &fSettings.click_speed);
|
ioctl(fDevice, MS_SET_CLICKSPEED, &fSettings.click_speed);
|
||||||
|
|
||||||
if (get_mouse_speed(&fSettings.accel.speed) != B_OK)
|
if (get_mouse_speed_by_name(fDeviceRef.name, &fSettings.accel.speed) != B_OK)
|
||||||
LOG_ERR("error when get_mouse_speed\n");
|
LOG_ERR("error when get_mouse_speed\n");
|
||||||
else {
|
else {
|
||||||
if (get_mouse_acceleration(&fSettings.accel.accel_factor) != B_OK)
|
if (get_mouse_acceleration(&fSettings.accel.accel_factor) != B_OK)
|
||||||
|
|||||||
@@ -509,6 +509,8 @@ get_mouse_type_by_name(BString mouse_name, int32 *type)
|
|||||||
{
|
{
|
||||||
BMessage command(IS_GET_MOUSE_TYPE);
|
BMessage command(IS_GET_MOUSE_TYPE);
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
|
command.AddString("mouse_name", mouse_name.String());
|
||||||
|
|
||||||
|
|
||||||
status_t err = _control_input_server_(&command, &reply);
|
status_t err = _control_input_server_(&command, &reply);
|
||||||
if (err != B_OK)
|
if (err != B_OK)
|
||||||
@@ -624,6 +626,38 @@ set_mouse_speed(int32 speed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
get_mouse_speed_by_name(BString mouse_name, int32 *speed)
|
||||||
|
{
|
||||||
|
BMessage command(IS_GET_MOUSE_SPEED);
|
||||||
|
BMessage reply;
|
||||||
|
command.AddString("mouse_name", mouse_name.String());
|
||||||
|
|
||||||
|
status_t err = _control_input_server_(&command, &reply);
|
||||||
|
if (err != B_OK)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
err = reply.FindInt32("speed", speed);
|
||||||
|
if (err != B_OK)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
set_mouse_speed_by_name(BString mouse_name, int32 speed)
|
||||||
|
{
|
||||||
|
BMessage command(IS_SET_MOUSE_SPEED);
|
||||||
|
BMessage reply;
|
||||||
|
command.AddString("mouse_name", mouse_name.String());
|
||||||
|
|
||||||
|
command.AddInt32("speed", speed);
|
||||||
|
|
||||||
|
return _control_input_server_(&command, &reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
get_mouse_acceleration(int32 *speed)
|
get_mouse_acceleration(int32 *speed)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ InputMouse::MessageReceived(BMessage* message)
|
|||||||
{
|
{
|
||||||
int32 type;
|
int32 type;
|
||||||
if (message->FindInt32("be:value", &type) == B_OK) {
|
if (message->FindInt32("be:value", &type) == B_OK) {
|
||||||
|
if (type > 6)
|
||||||
|
debugger("Mouse type is invalid");
|
||||||
fSettings->SetMouseType(type);
|
fSettings->SetMouseType(type);
|
||||||
fSettingsView->SetMouseType(type);
|
fSettingsView->SetMouseType(type);
|
||||||
fDefaultsButton->SetEnabled(fSettings->IsDefaultable());
|
fDefaultsButton->SetEnabled(fSettings->IsDefaultable());
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ static const int32 kDefaultAccelerationFactor = 65536;
|
|||||||
static const bool kDefaultAcceptFirstClick = true;
|
static const bool kDefaultAcceptFirstClick = true;
|
||||||
|
|
||||||
|
|
||||||
MouseSettings::MouseSettings()
|
MouseSettings::MouseSettings(BString name)
|
||||||
|
:
|
||||||
|
fName(name)
|
||||||
{
|
{
|
||||||
_RetrieveSettings();
|
_RetrieveSettings();
|
||||||
|
|
||||||
@@ -40,10 +42,12 @@ MouseSettings::MouseSettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MouseSettings::MouseSettings(mouse_settings settings)
|
MouseSettings::MouseSettings(mouse_settings settings, BString name)
|
||||||
:
|
:
|
||||||
fSettings(settings)
|
fSettings(settings)
|
||||||
{
|
{
|
||||||
|
fName = name;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Dump();
|
Dump();
|
||||||
#endif
|
#endif
|
||||||
@@ -72,39 +76,48 @@ MouseSettings::_GetSettingsPath(BPath &path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
MouseSettings::_RetrieveSettings()
|
MouseSettings::_RetrieveSettings()
|
||||||
{
|
{
|
||||||
// retrieve current values
|
// retrieve current values
|
||||||
|
|
||||||
if (get_mouse_map(&fSettings.map) != B_OK)
|
if (get_mouse_map(&fSettings.map) != B_OK)
|
||||||
fprintf(stderr, "error when get_mouse_map\n");
|
return B_ERROR;
|
||||||
if (get_click_speed(&fSettings.click_speed) != B_OK)
|
if (get_click_speed(&fSettings.click_speed) != B_OK)
|
||||||
fprintf(stderr, "error when get_click_speed\n");
|
return B_ERROR;
|
||||||
if (get_mouse_speed(&fSettings.accel.speed) != B_OK)
|
if (get_mouse_speed_by_name(fName, &fSettings.accel.speed) != B_OK)
|
||||||
fprintf(stderr, "error when get_mouse_speed\n");
|
return B_ERROR;
|
||||||
if (get_mouse_acceleration(&fSettings.accel.accel_factor) != B_OK)
|
if (get_mouse_acceleration(&fSettings.accel.accel_factor) != B_OK)
|
||||||
fprintf(stderr, "error when get_mouse_acceleration\n");
|
return B_ERROR;
|
||||||
if (get_mouse_type_by_name(fname, &fSettings.type) != B_OK)
|
if (get_mouse_type_by_name(fName, &fSettings.type) != B_OK)
|
||||||
fprintf(stderr, "error when get_multiple_mouse_type\n");
|
return B_ERROR;
|
||||||
|
|
||||||
fMode = mouse_mode();
|
fMode = mouse_mode();
|
||||||
fFocusFollowsMouseMode = focus_follows_mouse_mode();
|
fFocusFollowsMouseMode = focus_follows_mouse_mode();
|
||||||
fAcceptFirstClick = accept_first_click();
|
fAcceptFirstClick = accept_first_click();
|
||||||
|
|
||||||
// also try to load the window position from disk
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
MouseSettings::_LoadLegacySettings()
|
||||||
|
{
|
||||||
BPath path;
|
BPath path;
|
||||||
if (_GetSettingsPath(path) < B_OK)
|
if (_GetSettingsPath(path) < B_OK)
|
||||||
return;
|
return B_ERROR;
|
||||||
|
|
||||||
BFile file(path.Path(), B_READ_ONLY);
|
BFile file(path.Path(), B_READ_ONLY);
|
||||||
if (file.InitCheck() < B_OK)
|
if (file.InitCheck() < B_OK)
|
||||||
return;
|
return B_ERROR;
|
||||||
|
|
||||||
|
// Read the settings from the file
|
||||||
|
file.Read((void*)&fSettings, sizeof(mouse_settings));
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Dump();
|
Dump();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -113,9 +126,9 @@ void
|
|||||||
MouseSettings::Dump()
|
MouseSettings::Dump()
|
||||||
{
|
{
|
||||||
printf("type:\t\t%" B_PRId32 " button mouse\n", fSettings.type);
|
printf("type:\t\t%" B_PRId32 " button mouse\n", fSettings.type);
|
||||||
printf("map:\t\tleft = %" B_PRIu32 " : middle = %" B_PRIu32 " : right = %"
|
for (int i = 0; i < 5; i++) {
|
||||||
B_PRIu32 "\n", fSettings.map.button[0], fSettings.map.button[2],
|
printf("button[%d]: %" B_PRId32 "\n", i, fSettings.map.button[i]);
|
||||||
fSettings.map.button[1]);
|
}
|
||||||
printf("click speed:\t%" B_PRId64 "\n", fSettings.click_speed);
|
printf("click speed:\t%" B_PRId64 "\n", fSettings.click_speed);
|
||||||
printf("accel:\t\t%s\n", fSettings.accel.enabled ? "enabled" : "disabled");
|
printf("accel:\t\t%s\n", fSettings.accel.enabled ? "enabled" : "disabled");
|
||||||
printf("accel factor:\t%" B_PRId32 "\n", fSettings.accel.accel_factor);
|
printf("accel factor:\t%" B_PRId32 "\n", fSettings.accel.accel_factor);
|
||||||
@@ -238,7 +251,7 @@ MouseSettings::IsRevertable()
|
|||||||
void
|
void
|
||||||
MouseSettings::SetMouseType(int32 type)
|
MouseSettings::SetMouseType(int32 type)
|
||||||
{
|
{
|
||||||
if (set_mouse_type_by_name(fname, type) == B_OK)
|
if (set_mouse_type_by_name(fName, type) == B_OK)
|
||||||
fSettings.type = type;
|
fSettings.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,7 +277,7 @@ MouseSettings::SetClickSpeed(bigtime_t clickSpeed)
|
|||||||
void
|
void
|
||||||
MouseSettings::SetMouseSpeed(int32 speed)
|
MouseSettings::SetMouseSpeed(int32 speed)
|
||||||
{
|
{
|
||||||
if (set_mouse_speed(speed) == B_OK)
|
if (set_mouse_speed_by_name(fName, speed) == B_OK)
|
||||||
fSettings.accel.speed = speed;
|
fSettings.accel.speed = speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,14 +415,15 @@ MultipleMouseSettings::RetrieveSettings()
|
|||||||
while (message.FindString("mouseDevice", i, &deviceName) == B_OK) {
|
while (message.FindString("mouseDevice", i, &deviceName) == B_OK) {
|
||||||
message.FindData("mouseSettings", B_ANY_TYPE, i,
|
message.FindData("mouseSettings", B_ANY_TYPE, i,
|
||||||
(const void**)&settings, &size);
|
(const void**)&settings, &size);
|
||||||
MouseSettings* mouseSettings = new MouseSettings(*settings);
|
MouseSettings* mouseSettings
|
||||||
|
= new MouseSettings(*settings, deviceName);
|
||||||
fMouseSettingsObject.insert(std::pair<BString, MouseSettings*>
|
fMouseSettingsObject.insert(std::pair<BString, MouseSettings*>
|
||||||
(deviceName, mouseSettings));
|
(deviceName, mouseSettings));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Does not look like a BMessage, try loading using the old format
|
// Does not look like a BMessage, try loading using the old format
|
||||||
fDeprecatedMouseSettings = new MouseSettings();
|
fDeprecatedMouseSettings = new MouseSettings("");
|
||||||
fDeprecatedMouseSettings->_RetrieveSettings();
|
fDeprecatedMouseSettings->_RetrieveSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,10 +501,11 @@ MultipleMouseSettings::AddMouseSettings(BString mouse_name)
|
|||||||
(*fDeprecatedMouseSettings);
|
(*fDeprecatedMouseSettings);
|
||||||
|
|
||||||
if (RetrievedSettings != NULL) {
|
if (RetrievedSettings != NULL) {
|
||||||
|
RetrievedSettings->fName = mouse_name;
|
||||||
fMouseSettingsObject.insert(std::pair<BString, MouseSettings*>
|
fMouseSettingsObject.insert(std::pair<BString, MouseSettings*>
|
||||||
(mouse_name, RetrievedSettings));
|
(mouse_name, RetrievedSettings));
|
||||||
|
|
||||||
return RetrievedSettings;
|
return RetrievedSettings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,7 +515,7 @@ MultipleMouseSettings::AddMouseSettings(BString mouse_name)
|
|||||||
if (itr != fMouseSettingsObject.end())
|
if (itr != fMouseSettingsObject.end())
|
||||||
return GetMouseSettings(mouse_name);
|
return GetMouseSettings(mouse_name);
|
||||||
|
|
||||||
MouseSettings* settings = new (std::nothrow) MouseSettings();
|
MouseSettings* settings = new (std::nothrow) MouseSettings(mouse_name);
|
||||||
|
|
||||||
if(settings !=NULL) {
|
if(settings !=NULL) {
|
||||||
fMouseSettingsObject.insert(std::pair<BString, MouseSettings*>
|
fMouseSettingsObject.insert(std::pair<BString, MouseSettings*>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
#include "kb_mouse_settings.h"
|
#include "kb_mouse_settings.h"
|
||||||
|
|
||||||
@@ -26,8 +27,8 @@ class BPath;
|
|||||||
|
|
||||||
class MouseSettings {
|
class MouseSettings {
|
||||||
public:
|
public:
|
||||||
MouseSettings();
|
MouseSettings(BString name);
|
||||||
MouseSettings(mouse_settings settings);
|
MouseSettings(mouse_settings settings, BString name);
|
||||||
~MouseSettings();
|
~MouseSettings();
|
||||||
|
|
||||||
void Revert();
|
void Revert();
|
||||||
@@ -63,17 +64,21 @@ public:
|
|||||||
|
|
||||||
bool AcceptFirstClick() const { return fAcceptFirstClick; }
|
bool AcceptFirstClick() const { return fAcceptFirstClick; }
|
||||||
void SetAcceptFirstClick(bool accept_first_click);
|
void SetAcceptFirstClick(bool accept_first_click);
|
||||||
void _RetrieveSettings();
|
status_t _RetrieveSettings();
|
||||||
|
status_t _LoadLegacySettings();
|
||||||
|
|
||||||
mouse_settings* GetSettings();
|
mouse_settings* GetSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static status_t _GetSettingsPath(BPath &path);
|
static status_t _GetSettingsPath(BPath &path);
|
||||||
|
|
||||||
mode_mouse fMode, fOriginalMode;
|
private:
|
||||||
|
BString fName;
|
||||||
|
mode_mouse fMode, fOriginalMode;
|
||||||
mode_focus_follows_mouse fFocusFollowsMouseMode;
|
mode_focus_follows_mouse fFocusFollowsMouseMode;
|
||||||
mode_focus_follows_mouse fOriginalFocusFollowsMouseMode;
|
mode_focus_follows_mouse fOriginalFocusFollowsMouseMode;
|
||||||
bool fAcceptFirstClick, fOriginalAcceptFirstClick;
|
bool fAcceptFirstClick
|
||||||
|
bool fOriginalAcceptFirstClick;
|
||||||
|
|
||||||
mouse_settings fSettings, fOriginalSettings;
|
mouse_settings fSettings, fOriginalSettings;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -113,6 +113,8 @@ MouseView::MouseMapUpdated()
|
|||||||
void
|
void
|
||||||
MouseView::UpdateFromSettings()
|
MouseView::UpdateFromSettings()
|
||||||
{
|
{
|
||||||
|
if (fSettings.MouseType() > 6)
|
||||||
|
debugger("Mouse type is invalid");
|
||||||
SetMouseType(fSettings.MouseType());
|
SetMouseType(fSettings.MouseType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,6 +226,8 @@ SettingsView::AttachedToWindow()
|
|||||||
void
|
void
|
||||||
SettingsView::SetMouseType(int32 type)
|
SettingsView::SetMouseType(int32 type)
|
||||||
{
|
{
|
||||||
|
if (type > 6)
|
||||||
|
debugger("Mouse type is invalid");
|
||||||
fMouseView->SetMouseType(type);
|
fMouseView->SetMouseType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +255,8 @@ SettingsView::UpdateFromSettings()
|
|||||||
fAccelerationSlider->SetValue(value);
|
fAccelerationSlider->SetValue(value);
|
||||||
|
|
||||||
fTypeMenu->SelectOptionFor(fSettings.MouseType());
|
fTypeMenu->SelectOptionFor(fSettings.MouseType());
|
||||||
|
if (fSettings.MouseType() > 6)
|
||||||
|
debugger("Mouse type is invalid");
|
||||||
fMouseView->SetMouseType(fSettings.MouseType());
|
fMouseView->SetMouseType(fSettings.MouseType());
|
||||||
|
|
||||||
BMenuItem* item = fFocusMenu->ItemAt(
|
BMenuItem* item = fFocusMenu->ItemAt(
|
||||||
|
|||||||
@@ -857,6 +857,7 @@ status_t
|
|||||||
InputServer::HandleGetSetMouseSpeed(BMessage* message, BMessage* reply)
|
InputServer::HandleGetSetMouseSpeed(BMessage* message, BMessage* reply)
|
||||||
{
|
{
|
||||||
BString mouseName;
|
BString mouseName;
|
||||||
|
|
||||||
MouseSettings* settings = NULL;
|
MouseSettings* settings = NULL;
|
||||||
if (message->FindString("mouse_name", &mouseName) == B_OK) {
|
if (message->FindString("mouse_name", &mouseName) == B_OK) {
|
||||||
settings = fMouseSettings.GetMouseSettings(mouseName);
|
settings = fMouseSettings.GetMouseSettings(mouseName);
|
||||||
@@ -869,9 +870,12 @@ InputServer::HandleGetSetMouseSpeed(BMessage* message, BMessage* reply)
|
|||||||
if (settings != NULL)
|
if (settings != NULL)
|
||||||
settings->SetMouseSpeed(speed);
|
settings->SetMouseSpeed(speed);
|
||||||
else {
|
else {
|
||||||
// TODO if no mouse_name was specified, apply the setting to
|
std::map<BString, MouseSettings*>::iterator itr;
|
||||||
// all mouses
|
for (itr = fMouseSettingsObject.begin();
|
||||||
return B_NOT_SUPPORTED;
|
itr != fMouseSettingsObject.end(); ++itr) {
|
||||||
|
itr->second->SetMouseSpeed(speed);
|
||||||
|
}
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
be_app_messenger.SendMessage(IS_SAVE_SETTINGS);
|
be_app_messenger.SendMessage(IS_SAVE_SETTINGS);
|
||||||
|
|
||||||
@@ -884,8 +888,7 @@ InputServer::HandleGetSetMouseSpeed(BMessage* message, BMessage* reply)
|
|||||||
if (settings != NULL)
|
if (settings != NULL)
|
||||||
return reply->AddInt32("speed", settings->MouseSpeed());
|
return reply->AddInt32("speed", settings->MouseSpeed());
|
||||||
else {
|
else {
|
||||||
// TODO return type of the "first" mouse?
|
return B_OK;
|
||||||
return B_NOT_SUPPORTED;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -241,6 +241,9 @@ class InputServer : public BApplication {
|
|||||||
team_id fAppServerTeam;
|
team_id fAppServerTeam;
|
||||||
area_id fCursorArea;
|
area_id fCursorArea;
|
||||||
shared_cursor* fCursorBuffer;
|
shared_cursor* fCursorBuffer;
|
||||||
|
|
||||||
|
typedef std::map<BString, MouseSettings*> mouse_settings_object;
|
||||||
|
mouse_settings_object fMouseSettingsObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern InputServer* gInputServer;
|
extern InputServer* gInputServer;
|
||||||
|
|||||||
Reference in New Issue
Block a user