feat: web v2 keyboard (#9175)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
5abe42f66c
commit
4b4fd94f3e
@ -50,6 +50,9 @@ final isLinux = isLinux_;
|
|||||||
final isDesktop = isDesktop_;
|
final isDesktop = isDesktop_;
|
||||||
final isWeb = isWeb_;
|
final isWeb = isWeb_;
|
||||||
final isWebDesktop = isWebDesktop_;
|
final isWebDesktop = isWebDesktop_;
|
||||||
|
final isWebOnWindows = isWebOnWindows_;
|
||||||
|
final isWebOnLinux = isWebOnLinux_;
|
||||||
|
final isWebOnMacOs = isWebOnMacOS_;
|
||||||
var isMobile = isAndroid || isIOS;
|
var isMobile = isAndroid || isIOS;
|
||||||
var version = '';
|
var version = '';
|
||||||
int androidVersion = 0;
|
int androidVersion = 0;
|
||||||
|
@ -32,6 +32,7 @@ const String kPeerPlatformWindows = "Windows";
|
|||||||
const String kPeerPlatformLinux = "Linux";
|
const String kPeerPlatformLinux = "Linux";
|
||||||
const String kPeerPlatformMacOS = "Mac OS";
|
const String kPeerPlatformMacOS = "Mac OS";
|
||||||
const String kPeerPlatformAndroid = "Android";
|
const String kPeerPlatformAndroid = "Android";
|
||||||
|
const String kPeerPlatformWebDesktop = "WebDesktop";
|
||||||
|
|
||||||
const double kScrollbarThickness = 12.0;
|
const double kScrollbarThickness = 12.0;
|
||||||
|
|
||||||
|
@ -178,8 +178,9 @@ String getLocalPlatformForKBLayoutType(String peerPlatform) {
|
|||||||
localPlatform = kPeerPlatformWindows;
|
localPlatform = kPeerPlatformWindows;
|
||||||
} else if (isLinux) {
|
} else if (isLinux) {
|
||||||
localPlatform = kPeerPlatformLinux;
|
localPlatform = kPeerPlatformLinux;
|
||||||
|
} else if (isWebOnWindows || isWebOnLinux) {
|
||||||
|
localPlatform = kPeerPlatformWebDesktop;
|
||||||
}
|
}
|
||||||
// to-do: web desktop support ?
|
|
||||||
return localPlatform;
|
return localPlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,3 +11,7 @@ final isWebDesktop_ = false;
|
|||||||
final isDesktop_ = Platform.isWindows || Platform.isMacOS || Platform.isLinux;
|
final isDesktop_ = Platform.isWindows || Platform.isMacOS || Platform.isLinux;
|
||||||
|
|
||||||
String get screenInfo_ => '';
|
String get screenInfo_ => '';
|
||||||
|
|
||||||
|
final isWebOnWindows_ = false;
|
||||||
|
final isWebOnLinux_ = false;
|
||||||
|
final isWebOnMacOS_ = false;
|
||||||
|
@ -234,7 +234,7 @@ class RustdeskImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getLocalKbLayoutType({dynamic hint}) {
|
String getLocalKbLayoutType({dynamic hint}) {
|
||||||
throw js.context.callMethod('getByName', ['option:local', 'kb_layout']);
|
return js.context.callMethod('getByName', ['option:local', 'kb_layout']);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setLocalKbLayoutType(
|
Future<void> setLocalKbLayoutType(
|
||||||
@ -415,6 +415,17 @@ class RustdeskImpl {
|
|||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> sessionHandleFlutterRawKeyEvent(
|
||||||
|
{required UuidValue sessionId,
|
||||||
|
required String name,
|
||||||
|
required int platformCode,
|
||||||
|
required int positionCode,
|
||||||
|
required int lockModes,
|
||||||
|
required bool downOrUp,
|
||||||
|
dynamic hint}) {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
|
|
||||||
void sessionEnterOrLeave(
|
void sessionEnterOrLeave(
|
||||||
{required UuidValue sessionId, required bool enter, dynamic hint}) {
|
{required UuidValue sessionId, required bool enter, dynamic hint}) {
|
||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'dart:js' as js;
|
import 'dart:js' as js;
|
||||||
|
import 'dart:html' as html;
|
||||||
|
|
||||||
final isAndroid_ = false;
|
final isAndroid_ = false;
|
||||||
final isIOS_ = false;
|
final isIOS_ = false;
|
||||||
@ -11,3 +12,9 @@ final isWebDesktop_ = !js.context.callMethod('isMobile');
|
|||||||
final isDesktop_ = false;
|
final isDesktop_ = false;
|
||||||
|
|
||||||
String get screenInfo_ => js.context.callMethod('getByName', ['screen_info']);
|
String get screenInfo_ => js.context.callMethod('getByName', ['screen_info']);
|
||||||
|
|
||||||
|
final _userAgent = html.window.navigator.userAgent.toLowerCase();
|
||||||
|
|
||||||
|
final isWebOnWindows_ = _userAgent.contains('win');
|
||||||
|
final isWebOnLinux_ = _userAgent.contains('linux');
|
||||||
|
final isWebOnMacOS_ = _userAgent.contains('mac');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user