mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-12-09 05:29:12 +00:00
27 lines
566 B
Haxe
27 lines
566 B
Haxe
package funkin.external.android;
|
|
|
|
#if android
|
|
import lime.system.JNI;
|
|
|
|
/**
|
|
* Utility class for keyboard detection.
|
|
*/
|
|
class KeyboardUtil
|
|
{
|
|
/**
|
|
* Returns `true` if a keyboard is currently connected to the device.
|
|
*/
|
|
public static var keyboardConnected(get, never):Bool;
|
|
|
|
@:noCompletion
|
|
static function get_keyboardConnected():Bool
|
|
{
|
|
final method:Null<Dynamic> = JNIUtil.createStaticMethod('funkin/util/KeyboardUtil', 'isKeyboardConnected', '()Z');
|
|
|
|
if (method == null) return false;
|
|
|
|
return inline JNI.callStatic(method, []);
|
|
}
|
|
}
|
|
#end
|