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 isWeb = isWeb_;
|
||||
final isWebDesktop = isWebDesktop_;
|
||||
final isWebOnWindows = isWebOnWindows_;
|
||||
final isWebOnLinux = isWebOnLinux_;
|
||||
final isWebOnMacOs = isWebOnMacOS_;
|
||||
var isMobile = isAndroid || isIOS;
|
||||
var version = '';
|
||||
int androidVersion = 0;
|
||||
|
@ -32,6 +32,7 @@ const String kPeerPlatformWindows = "Windows";
|
||||
const String kPeerPlatformLinux = "Linux";
|
||||
const String kPeerPlatformMacOS = "Mac OS";
|
||||
const String kPeerPlatformAndroid = "Android";
|
||||
const String kPeerPlatformWebDesktop = "WebDesktop";
|
||||
|
||||
const double kScrollbarThickness = 12.0;
|
||||
|
||||
|
@ -178,8 +178,9 @@ String getLocalPlatformForKBLayoutType(String peerPlatform) {
|
||||
localPlatform = kPeerPlatformWindows;
|
||||
} else if (isLinux) {
|
||||
localPlatform = kPeerPlatformLinux;
|
||||
} else if (isWebOnWindows || isWebOnLinux) {
|
||||
localPlatform = kPeerPlatformWebDesktop;
|
||||
}
|
||||
// to-do: web desktop support ?
|
||||
return localPlatform;
|
||||
}
|
||||
|
||||
|
@ -11,3 +11,7 @@ final isWebDesktop_ = false;
|
||||
final isDesktop_ = Platform.isWindows || Platform.isMacOS || Platform.isLinux;
|
||||
|
||||
String get screenInfo_ => '';
|
||||
|
||||
final isWebOnWindows_ = false;
|
||||
final isWebOnLinux_ = false;
|
||||
final isWebOnMacOS_ = false;
|
||||
|
@ -234,7 +234,7 @@ class RustdeskImpl {
|
||||
}
|
||||
|
||||
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(
|
||||
@ -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(
|
||||
{required UuidValue sessionId, required bool enter, dynamic hint}) {
|
||||
throw UnimplementedError();
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'dart:js' as js;
|
||||
import 'dart:html' as html;
|
||||
|
||||
final isAndroid_ = false;
|
||||
final isIOS_ = false;
|
||||
@ -11,3 +12,9 @@ final isWebDesktop_ = !js.context.callMethod('isMobile');
|
||||
final isDesktop_ = false;
|
||||
|
||||
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