【发布时间】:2011-05-21 07:44:27
【问题描述】:
基本上,我想知道我的 GWT 应用程序是否在 MacOS 或任何其他操作系统上运行,以便在 MacOS 上使用 cmd 和 ctrl 正确设置快捷方式 其他地方。
【问题讨论】:
标签: macos gwt operating-system keyboard-shortcuts
基本上,我想知道我的 GWT 应用程序是否在 MacOS 或任何其他操作系统上运行,以便在 MacOS 上使用 cmd 和 ctrl 正确设置快捷方式 其他地方。
【问题讨论】:
标签: macos gwt operating-system keyboard-shortcuts
你可以使用:
import com.google.gwt.user.client.Window.Navigator;
...
String platform = Navigator.getPlatform();
这将返回一个字符串(与 JavaScript 的 navigator.platform 相同)。然后您可以决定类似于this script 的操作系统:它只检查子字符串“Win”/“Mac”/“iPhone”/“Linux”。
【讨论】: