Keyboard input

Create issue
Issue #5 resolved
Martin Felis repo owner created an issue

As slime noted this should work somewhat automatically. Still this should be validated

Comments (9)

  1. Pavol Rusnak

    Tested with USB keyboard plugged in via USB OTG and it works just fine. I think we can close this.

  2. Alex Szpakowski

    Try love.keyboard.setTextInput(true).

    I'll eventually update the function to optionally specify the rectangle for where the OSK should go, probably.

  3. Pavol Rusnak

    I confirm that calling love.keyboard.setTextInput(true) shows on-screen-keyboard and using it fires love.textinput(t) callback correctly.

    Attaching main.lua for reference:

    function love.load()
        text = "Type away! -- "
        love.keyboard.setTextInput(true)
    end
    
    function love.textinput(t)
        text = text .. t
    end
    
    function love.draw()
        love.graphics.printf(text, 0, 0, love.graphics.getWidth())
    end
    
  4. Log in to comment