Skip to content

feat: Add mobile keyboard support for Emscripten builds#4

Open
itsthisjustin wants to merge 1 commit intoDavidobot:emscriptenfrom
itsthisjustin:feat/mobile-keyboard-support
Open

feat: Add mobile keyboard support for Emscripten builds#4
itsthisjustin wants to merge 1 commit intoDavidobot:emscriptenfrom
itsthisjustin:feat/mobile-keyboard-support

Conversation

@itsthisjustin
Copy link

@itsthisjustin itsthisjustin commented Oct 7, 2025

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 enabled
  • window.SDL_StopTextInput() when text input is disabled

The 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant