2023-10-28 19:56:34 -04:00
|
|
|
package funkin.util;
|
|
|
|
|
2023-11-07 04:04:22 -05:00
|
|
|
/**
|
|
|
|
* Utility functions related to specific platforms.
|
|
|
|
*/
|
2023-10-28 19:56:34 -04:00
|
|
|
class PlatformUtil
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns true if the current platform is MacOS.
|
|
|
|
*
|
|
|
|
* NOTE: Only use this for choosing modifier keys for shortcut hints.
|
|
|
|
* @return Whether the current platform is MacOS, or HTML5 running on MacOS.
|
|
|
|
*/
|
|
|
|
public static function isMacOS():Bool
|
|
|
|
{
|
|
|
|
#if mac
|
|
|
|
return true;
|
|
|
|
#elseif html5
|
2023-11-05 00:26:03 -04:00
|
|
|
return js.Browser.window.navigator.platform.startsWith("Mac")
|
|
|
|
|| js.Browser.window.navigator.platform.startsWith("iPad")
|
|
|
|
|| js.Browser.window.navigator.platform.startsWith("iPhone");
|
2023-10-28 19:56:34 -04:00
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#end
|
|
|
|
}
|
|
|
|
}
|