Trackpad speed, user default value

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2025-05-09 10:56:21 +08:00
parent 26ba1263e2
commit 5afa5e2c08
55 changed files with 195 additions and 56 deletions

View file

@ -1624,29 +1624,14 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
}
trackpadSpeedDialog(SessionID sessionId, FFI ffi) async {
final speed = await bind.sessionGetFlutterOption(
sessionId: sessionId, k: kKeyTrackpadSpeed);
var initSpeed = kDefaultTrackpadSpeed;
if (speed != null && speed.isNotEmpty) {
try {
initSpeed = double.parse(speed);
} catch (e) {
debugPrint('Failed to parse the trackpad speed, "$speed": $e');
}
}
if (initSpeed < kMinTrackpadSpeed || initSpeed > kMaxTrackpadSpeed) {
initSpeed = kDefaultTrackpadSpeed;
}
int initSpeed = ffi.inputModel.trackpadSpeed;
final curSpeed = SimpleWrapper(initSpeed);
final btnClose = dialogButton('Close', onPressed: () async {
if (curSpeed.value <= kMaxTrackpadSpeed &&
curSpeed.value >= kMinTrackpadSpeed &&
(curSpeed.value - initSpeed).abs() > 0.01) {
await bind.sessionSetFlutterOption(
sessionId: sessionId,
k: kKeyTrackpadSpeed,
v: curSpeed.value.toString());
curSpeed.value != initSpeed) {
await bind.sessionSetTrackpadSpeed(
sessionId: sessionId, value: curSpeed.value);
await ffi.inputModel.updateTrackpadSpeed();
}
ffi.dialogManager.dismissAll();

View file

@ -250,9 +250,11 @@ List<(String, String)> otherDefaultSettings() {
}
class TrackpadSpeedWidget extends StatefulWidget {
final SimpleWrapper<double> value;
final SimpleWrapper<int> value;
// If null, no debouncer will be applied.
final Function(int)? onDebouncer;
TrackpadSpeedWidget({Key? key, required this.value});
TrackpadSpeedWidget({Key? key, required this.value, this.onDebouncer});
@override
TrackpadSpeedWidgetState createState() => TrackpadSpeedWidgetState();
@ -260,33 +262,47 @@ class TrackpadSpeedWidget extends StatefulWidget {
class TrackpadSpeedWidgetState extends State<TrackpadSpeedWidget> {
final TextEditingController _controller = TextEditingController();
late final Debouncer<int> debouncerSpeed;
set value(double v) => widget.value.value = v;
double get value => widget.value.value;
set value(int v) => widget.value.value = v;
int get value => widget.value.value;
void updateValue(double newValue) {
void updateValue(int newValue) {
setState(() {
value = newValue.clamp(kMinTrackpadSpeed, kMaxTrackpadSpeed);
// Scale the trackpad speed value to a percentage for display purposes.
_controller.text = ((value * 100.0).round()).toString();
_controller.text = value.toString();
if (widget.onDebouncer != null) {
debouncerSpeed.setValue(value);
}
});
}
@override
void initState() {
super.initState();
debouncerSpeed = Debouncer<int>(
Duration(milliseconds: 1000),
onChanged: widget.onDebouncer,
initialValue: widget.value.value,
);
}
@override
Widget build(BuildContext context) {
if (_controller.text.isEmpty) {
_controller.text = ((value * 100.0).round()).toString();
_controller.text = value.toString();
}
return Row(
children: [
Expanded(
flex: 3,
child: Slider(
value: value,
min: kMinTrackpadSpeed,
max: kMaxTrackpadSpeed,
divisions: ((kMaxTrackpadSpeed - kMinTrackpadSpeed) / 0.1).round(),
onChanged: (double v) => updateValue(v),
value: value.toDouble(),
min: kMinTrackpadSpeed.toDouble(),
max: kMaxTrackpadSpeed.toDouble(),
divisions: ((kMaxTrackpadSpeed - kMinTrackpadSpeed) / 10).round(),
onChanged: (double v) => updateValue(v.round()),
),
),
Expanded(
@ -302,7 +318,7 @@ class TrackpadSpeedWidgetState extends State<TrackpadSpeedWidget> {
onSubmitted: (text) {
int? v = int.tryParse(text);
if (v != null) {
updateValue(v.toDouble() / 100.0);
updateValue(v);
}
},
style: const TextStyle(fontSize: 13),

View file

@ -228,9 +228,9 @@ const double kMaxMoreQuality = 2000;
// trackpad speed
const String kKeyTrackpadSpeed = 'trackpad-speed';
const double kMinTrackpadSpeed = 0.1;
const double kDefaultTrackpadSpeed = 1.0;
const double kMaxTrackpadSpeed = 10;
const int kMinTrackpadSpeed = 10;
const int kDefaultTrackpadSpeed = 100;
const int kMaxTrackpadSpeed = 1000;
// incomming (should be incoming) is kept, because change it will break the previous setting.
const String kKeyPrinterIncomingJobAction = 'printer-incomming-job-action';

View file

@ -76,7 +76,9 @@ class DesktopSettingPage extends StatefulWidget {
if (!isWeb && !bind.isIncomingOnly() && bind.pluginFeatureIsEnabled())
SettingsTabKey.plugin,
if (!bind.isDisableAccount()) SettingsTabKey.account,
if (isWindows && bind.mainGetBuildinOption(key: kOptionHideRemotePrinterSetting) != 'Y') SettingsTabKey.printer,
if (isWindows &&
bind.mainGetBuildinOption(key: kOptionHideRemotePrinterSetting) != 'Y')
SettingsTabKey.printer,
SettingsTabKey.about,
];
@ -1602,6 +1604,7 @@ class _DisplayState extends State<_Display> {
scrollStyle(context),
imageQuality(context),
codec(context),
if (isDesktop) trackpadSpeed(context),
if (!isWeb) privacyModeImpl(context),
other(context),
]).marginOnly(bottom: _kListViewBottomMargin);
@ -1689,6 +1692,26 @@ class _DisplayState extends State<_Display> {
]);
}
Widget trackpadSpeed(BuildContext context) {
final initSpeed = (int.tryParse(
bind.mainGetUserDefaultOption(key: kKeyTrackpadSpeed)) ??
kDefaultTrackpadSpeed);
final curSpeed = SimpleWrapper(initSpeed);
void onDebouncer(int v) {
bind.mainSetUserDefaultOption(
key: kKeyTrackpadSpeed, value: v.toString());
// It's better to notify all sessions that the default speed is changed.
// But it may also be ok to take effect in the next connection.
}
return _Card(title: 'Default trackpad speed', children: [
TrackpadSpeedWidget(
value: curSpeed,
onDebouncer: onDebouncer,
),
]);
}
Widget codec(BuildContext context) {
onChanged(String value) async {
await bind.mainSetUserDefaultOption(

View file

@ -348,7 +348,8 @@ class InputModel {
final _trackpadAdjustPeerLinux = 0.06;
// This is an experience value.
final _trackpadAdjustMacToWin = 2.50;
double _trackpadSpeed = kDefaultTrackpadSpeed;
int _trackpadSpeed = kDefaultTrackpadSpeed;
double _trackpadSpeedInner = kDefaultTrackpadSpeed / 100.0;
var _trackpadScrollUnsent = Offset.zero;
var _lastScale = 1.0;
@ -372,6 +373,7 @@ class InputModel {
bool get isViewOnly => parent.target!.ffiModel.viewOnly;
double get devicePixelRatio => parent.target!.canvasModel.devicePixelRatio;
bool get isViewCamera => parent.target!.connType == ConnType.viewCamera;
int get trackpadSpeed => _trackpadSpeed;
InputModel(this.parent) {
sessionId = parent.target!.sessionId;
@ -387,33 +389,26 @@ class InputModel {
}
}
/// Updates the trackpad speed based on the session option value.
///
/// This function retrieves the trackpad speed setting from the session
/// using `sessionGetFlutterOption`. The expected format of the retrieved
/// value is a string that can be parsed into a double. If parsing fails
/// or the value is out of bounds (less than `kMinTrackpadSpeed` or greater
/// Updates the trackpad speed based on the session value.
///
/// The expected format of the retrieved value is a string that can be parsed into a double.
/// If parsing fails or the value is out of bounds (less than `kMinTrackpadSpeed` or greater
/// than `kMaxTrackpadSpeed`), the trackpad speed is reset to the default
/// value (`kDefaultTrackpadSpeed`).
///
///
/// Bounds:
/// - Minimum: `kMinTrackpadSpeed`
/// - Maximum: `kMaxTrackpadSpeed`
/// - Default: `kDefaultTrackpadSpeed`
Future<void> updateTrackpadSpeed() async {
final speed = await bind.sessionGetFlutterOption(
sessionId: sessionId, k: kKeyTrackpadSpeed);
if (speed != null && speed.isNotEmpty) {
try {
_trackpadSpeed = double.parse(speed);
} catch (e) {
debugPrint('Failed to parse the trackpad speed, "$speed": $e');
}
}
_trackpadSpeed =
(await bind.sessionGetTrackpadSpeed(sessionId: sessionId) ??
kDefaultTrackpadSpeed);
if (_trackpadSpeed < kMinTrackpadSpeed ||
_trackpadSpeed > kMaxTrackpadSpeed) {
_trackpadSpeed = kDefaultTrackpadSpeed;
}
_trackpadSpeedInner = _trackpadSpeed / 100.0;
}
void handleKeyDownEventModifiers(KeyEvent e) {
@ -919,7 +914,7 @@ class InputModel {
}
}
var delta = e.panDelta * _trackpadSpeed;
var delta = e.panDelta * _trackpadSpeedInner;
if (isMacOS && peerPlatform == kPeerPlatformWindows) {
delta *= _trackpadAdjustMacToWin;
}
@ -1023,7 +1018,7 @@ class InputModel {
_stopFling = false;
// 2.0 is an experience value
double minFlingValue = 2.0 * _trackpadSpeed;
double minFlingValue = 2.0 * _trackpadSpeedInner;
if (isMacOS && peerPlatform == kPeerPlatformWindows) {
minFlingValue *= _trackpadAdjustMacToWin;
}

@ -1 +1 @@
Subproject commit 751b9711febb8a1a8c40d98b156381072a9459a0
Subproject commit 6e556f7e1751a3a709cd5cca0df7268ba3cb1c48

View file

@ -2105,6 +2105,12 @@ impl LoginConfigHandler {
res
}
pub fn save_trackpad_speed(&mut self, speed: i32) {
let mut config = self.load_config();
config.trackpad_speed = speed;
self.save_config(config);
}
/// Create a [`Message`] for saving custom fps.
///
/// # Arguments

View file

@ -492,6 +492,20 @@ pub fn session_set_custom_fps(session_id: SessionID, fps: i32) {
}
}
pub fn session_get_trackpad_speed(session_id: SessionID) -> Option<i32> {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
Some(session.get_trackpad_speed())
} else {
None
}
}
pub fn session_set_trackpad_speed(session_id: SessionID, value: i32) {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
session.save_trackpad_speed(value);
}
}
pub fn session_lock_screen(session_id: SessionID) {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
session.lock_screen();

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", "安装方式检测失败。请点击\"下载\"按钮,从发布网址下载,并手动升级。"),
("websocket_tip", "使用 WebSocket 时,仅支持中继连接。"),
("Use WebSocket", "使用 WebSocket"),
("Trackpad speed", "触控板速度"),
("Default trackpad speed", "默认触控板速度"),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", "Prüfung der Installationsmethode fehlgeschlagen. Bitte klicken Sie auf die Schaltfläche \"Herunterladen\", um von der Versionsseite herunterzuladen und manuell zu aktualisieren."),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", "Controllo metodo installazione non riuscito.\nSeleziona 'Download' per scaricare il programma e aggiornarlo manualmente."),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", "업데이트에 실패했습니다. .msi 설치 파일을 확인하세요."),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", "Kan de installatiemethode niet bepalen. Klik op “Downloaden” om de applicatie van de officiële website te downloaden en handmatig bij te werken."),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", "Sprawdzenie metody instalacji nie powiodło się. Kliknij przycisk \"Pobierz\", aby pobrać ze strony wydania i uaktualnić ręcznie."),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", "Невозможно определить метод установки. Нажмите кнопку \"Скачать\", чтобы скачать приложение с официального сайта и обновить его вручную."),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -696,5 +696,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("update-failed-check-msi-tip", ""),
("websocket_tip", ""),
("Use WebSocket", ""),
("Trackpad speed", ""),
("Default trackpad speed", ""),
].iter().cloned().collect();
}

View file

@ -230,6 +230,10 @@ impl<T: InvokeUiSession> Session<T> {
self.lc.read().unwrap().version.clone()
}
pub fn get_trackpad_speed(&self) -> i32 {
self.lc.read().unwrap().trackpad_speed
}
pub fn fallback_keyboard_mode(&self) -> String {
let peer_version = self.get_peer_version();
let platform = self.peer_platform();
@ -448,6 +452,10 @@ impl<T: InvokeUiSession> Session<T> {
}
}
pub fn save_trackpad_speed(&self, trackpad_speed: i32) {
self.lc.write().unwrap().save_trackpad_speed(trackpad_speed);
}
pub fn set_custom_fps(&self, custom_fps: i32) {
let msg = self.lc.write().unwrap().set_custom_fps(custom_fps, true);
self.send(Data::Message(msg));