1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-10 08:44:47 +00:00
Funkin/source/funkin/util/PlatformUtil.hx

24 lines
596 B
Haxe
Raw Normal View History

2023-10-28 23:56:34 +00:00
package funkin.util;
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
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 23:56:34 +00:00
#else
return false;
#end
}
}