feat: Add mobile keyboard support for Emscripten builds#4
Open
itsthisjustin wants to merge 1 commit intoDavidobot:emscriptenfrom
Open
feat: Add mobile keyboard support for Emscripten builds#4itsthisjustin wants to merge 1 commit intoDavidobot:emscriptenfrom
itsthisjustin wants to merge 1 commit intoDavidobot:emscriptenfrom
Conversation
Add JavaScript hooks when text input is enabled/disabled. This allows love.keyboard.setTextInput(true) to trigger mobile keyboards on iOS/Android browsers. JavaScript implementation in love.js handles the browser security requirement for synchronous focus during touch events. Usage: Call love.keyboard.setTextInput(true) in your game and the mobile keyboard will appear when user taps the canvas.
itsthisjustin
added a commit
to itsthisjustin/megasource
that referenced
this pull request
Oct 7, 2025
Required for Emscripten 2.0.34+ compatibility. Emscripten 2.0.34 requires CMake >= 3.10. This enables ARM64 Mac builds. Updated CMakeLists.txt in: - Root directory - freetype-2.8.1 - libmodplug-0.8.8.4 - libogg-1.3.2 - libtheora-1.1.1 - libvorbis-1.3.5 - lua-5.1.5 - mpg123-1.25.6 - zlib-1.2.12 Note: love submodule CMakeLists.txt is updated in PR Davidobot/love#4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add JavaScript hooks when text input is enabled/disabled.
This allows love.keyboard.setTextInput(true) to trigger mobile keyboards on iOS/Android browsers.
JavaScript implementation in love.js handles the browser security requirement for synchronous focus during touch events.
Usage
Call
love.keyboard.setTextInput(true)in your game and the mobile keyboard will appear when user taps the canvas.Implementation
Adds Emscripten-specific hooks in Keyboard::setTextInput() that call:
window.SDL_StartTextInput()when text input is enabledwindow.SDL_StopTextInput()when text input is disabledThe JavaScript side (in love.js PR love2d#112) handles the actual keyboard activation with a two-phase approach to satisfy browser security requirements.
Related PRs