mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
fix build
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
77c4cce368
commit
c845ddf510
@ -310,7 +310,7 @@ class _RemotePageState extends State<RemotePage>
|
||||
}
|
||||
|
||||
void leaveView(PointerExitEvent evt) {
|
||||
if (_ffi.ffiModel.keyboard()) {
|
||||
if (_ffi.ffiModel.keyboard) {
|
||||
_ffi.inputModel.tryMoveEdgeOnExit(evt.position);
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,8 @@ class InputModel {
|
||||
|
||||
get id => parent.target?.id ?? "";
|
||||
|
||||
bool get keyboardPerm => parent.target!.ffiModel.keyboard;
|
||||
|
||||
InputModel(this.parent);
|
||||
|
||||
KeyEventResult handleRawKeyEvent(FocusNode data, RawKeyEvent e) {
|
||||
@ -203,7 +205,7 @@ class InputModel {
|
||||
/// [down] indicates the key's state(down or up).
|
||||
/// [press] indicates a click event(down and up).
|
||||
void inputKey(String name, {bool? down, bool? press}) {
|
||||
if (!parent.target!.ffiModel.keyboard()) return;
|
||||
if (!keyboardPerm) return;
|
||||
bind.sessionInputKey(
|
||||
id: id,
|
||||
name: name,
|
||||
@ -286,7 +288,7 @@ class InputModel {
|
||||
|
||||
/// Send mouse press event.
|
||||
void sendMouse(String type, MouseButtons button) {
|
||||
if (!parent.target!.ffiModel.keyboard()) return;
|
||||
if (!keyboardPerm) return;
|
||||
bind.sessionSendMouse(
|
||||
id: id,
|
||||
msg: json.encode(modify({'type': type, 'buttons': button.value})));
|
||||
@ -303,7 +305,7 @@ class InputModel {
|
||||
|
||||
/// Send mouse movement event with distance in [x] and [y].
|
||||
void moveMouse(double x, double y) {
|
||||
if (!parent.target!.ffiModel.keyboard()) return;
|
||||
if (!keyboardPerm) return;
|
||||
var x2 = x.toInt();
|
||||
var y2 = y.toInt();
|
||||
bind.sessionSendMouse(
|
||||
@ -379,7 +381,7 @@ class InputModel {
|
||||
}
|
||||
|
||||
void _scheduleFling2(double x, double y, int delay) {
|
||||
if ((x ==0 && y == 0) || _stopFling) {
|
||||
if ((x == 0 && y == 0) || _stopFling) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -394,7 +396,7 @@ class InputModel {
|
||||
final dx0 = x * _trackpadSpeed * 2;
|
||||
final dy0 = y * _trackpadSpeed * 2;
|
||||
|
||||
// Try set delta (x,y) and delay.
|
||||
// Try set delta (x,y) and delay.
|
||||
var dx = dx0.toInt();
|
||||
var dy = dy0.toInt();
|
||||
var delay = _flingBaseDelay;
|
||||
@ -432,7 +434,8 @@ class InputModel {
|
||||
void onPointerPanZoomEnd(PointerPanZoomEndEvent e) {
|
||||
_stopFling = false;
|
||||
_trackpadScrollUnsent = Offset.zero;
|
||||
_scheduleFling2(_trackpadLastDelta.dx, _trackpadLastDelta.dy, _flingBaseDelay);
|
||||
_scheduleFling2(
|
||||
_trackpadLastDelta.dx, _trackpadLastDelta.dy, _flingBaseDelay);
|
||||
_trackpadLastDelta = Offset.zero;
|
||||
}
|
||||
|
||||
|
@ -906,7 +906,7 @@ class CanvasModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
// If keyboard is not permitted, do not move cursor when mouse is moving.
|
||||
if (parent.target != null && parent.target!.ffiModel.keyboard()) {
|
||||
if (parent.target != null && parent.target!.ffiModel.keyboard) {
|
||||
// Draw cursor if is not desktop.
|
||||
if (!isDesktop) {
|
||||
parent.target!.cursorModel.moveLocal(x, y);
|
||||
|
@ -7,7 +7,7 @@ use hbb_common::{
|
||||
anyhow::{anyhow, Context},
|
||||
bytes::Bytes,
|
||||
config::HwCodecConfig,
|
||||
get_time, lazy_static, log,
|
||||
lazy_static, log,
|
||||
message_proto::{EncodedVideoFrame, EncodedVideoFrames, Message, VideoFrame},
|
||||
ResultType,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user