{'en': 'GameFrameX OperationKeyboard Package', 'zh-CN': 'GameFrameX OperationKeyboard 键盘组件', 'zh-TW': 'GameFrameX OperationKeyboard 鍵盤組件', 'ja': 'GameFrameX OperationKeyboard パッケージ', 'ko': 'GameFrameX OperationKeyboard 패키지'}
All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams
Documentation · Quick Start · QQ Group: 467608841 / 233840761
GameFrameX OperationKeyboard is the keyboard core package of the GameFrameX framework: a channel registry drives the mini-game platform keyboards (WeChat / Alipay / Kuaishou / Douyin showKeyboard family), a UI-agnostic field contract drives input fields, and the static facade owns single-slot field arbitration.
- Single-Slot Field Arbitration - only one
IOperationKeyboardFieldholds the keyboard at a time; attaching a new field automatically hides the keyboard and ends the previous field's session (fixes the double-subscription conflict of per-field adapters at the root) - Channel Registry -
OperationKeyboardRegistrywith registration-order mutually exclusive resolution, idempotentRegister(first wins with a warning),ResetatSubsystemRegistration, lazy factory instantiation with caching - maxLength Always -1 - mini-game keyboards count the pinyin composition string, so a hard cap truncates Chinese input mid-composition (verified on device); the cap is always passed as -1 and length clamping is left to game code
- No-Op Without Channel - Editor / native platforms / projects without a mini-game SDK: the facade intercepts nothing and the native
TouchScreenKeyboardpath is fully preserved
- Unity 2019.4 or higher
Choose one of the following methods:
-
Edit your Unity project's
Packages/manifest.jsonand add thescopedRegistriessection:{ "scopedRegistries": [ { "name": "GameFrameX", "url": "https://gameframex.upm.alianblank.uk", "scopes": [ "com.gameframex" ] } ], "dependencies": { "com.gameframex.unity.operationkeyboard": "1.0.0" } }scopescontrols which packages are resolved through this registry. Only packages whose names start withcom.gameframexwill be fetched from it. -
Add to
manifest.jsondependencies:{ "com.gameframex.unity.operationkeyboard": "https://github.com/gameframex/com.gameframex.unity.operationkeyboard.git" } -
Use Package Manager in Unity with Git URL:
https://github.com/gameframex/com.gameframex.unity.operationkeyboard.git -
Clone the repository into your Unity project's
Packagesdirectory. It will be loaded automatically.
using GameFrameX.OperationKeyboard.Runtime;
// UI binding packages (com.gameframex.unity.operationkeyboard.ugui) drive the session
// automatically on focus / blur - game code normally never touches the facade directly.
// Programmatic update while the keyboard is shown
OperationKeyboard.UpdateValue("programmatic value");
// Keyboard height for avoidance layout (0 = collapsed; empty implementation on platforms without the API)
OperationKeyboard.OnHeightChanged(height => { /* lift the UI here */ });OperationKeyboard.Attach(field) derives the keyboard option from the field contract (DefaultValue = field text, MaxLength always -1, Multiple, ConfirmType) and preempts any previous field (Hide() + one TriggerEndEdit() on the old field). The event flow mirrors native mobile so business callbacks need zero changes:
- input -
field.Text = value(onValueChangedfires as usual) + caret moved to the end; - confirm / complete - final value assigned, keyboard hidden,
EndEdittriggered (same as the native Done button); - blur -
Detach(keyboard hidden; the blurEndEditis produced by the field's own blur chain, never duplicated).
Each channel package registers its factory into OperationKeyboardRegistry via its own XxxOperationKeyboardBootstrap (RuntimeInitializeOnLoadMethod(BeforeSceneLoad)); uninstalled channel packages are stripped by the macro wall, so no registration happens (referencing means registering). When nothing is registered the facade is a no-op - the native keyboard path IS the fallback.
The registry answers "which platform keyboard"; UI binding packages answer "which UI toolkit" - the two axes are orthogonal and combine into automatic adaptation. com.gameframex.unity.operationkeyboard.ugui binds InputField + TMP_InputField with an auto-binder (zero panel changes); the FairyGUI binding ships separately.
IOperationKeyboardManager: platform contractShow(OperationKeyboardShowOption)/Hide()/UpdateValue(string)+ single-slot eventsOnInput/OnConfirm/OnComplete/OnHeightChanged;Hidemust unregister every platform event.IOperationKeyboardField: UI-agnostic field contractText/IsFocused/Multiline/ConfirmType/MoveTextEnd()/TriggerEndEdit().OperationKeyboardShowOption: show parameters;MaxLengthis always -1.OperationKeyboardRegistry/OperationKeyboardChannelRegistration: channel registry and registration descriptor (id + display name + factory).OperationKeyboard: static facade;Attach/Detach/CurrentFieldsingle-slot session,Hide/UpdateValue/OnHeightChangedforwarding.
| Platform | Implementation |
|---|---|
| Editor / Standalone / Mobile native | facade no-op, native TouchScreenKeyboard path preserved |
| WeChat / Alipay / Kuaishou / Douyin Mini Games | channel packages |
- Documentation: https://gameframex.doc.alianblank.com
- Issue Tracker: GitHub Issues
- QQ Group: 467608841
- Feature Requests: GitHub Discussions
| Package | Description |
|---|---|
| com.gameframex.unity | GameFrameX core |
See Releases for changelog.
See LICENSE.md for license information.