Skip to content
This repository has been archived by the owner on Feb 20, 2018. It is now read-only.

On iOS the soft keyboard can not use ESC etc. #2

Open
FreeBlues opened this issue Sep 9, 2017 · 17 comments
Open

On iOS the soft keyboard can not use ESC etc. #2

FreeBlues opened this issue Sep 9, 2017 · 17 comments

Comments

@FreeBlues
Copy link
Contributor

On iOS, the default soft keyboard called with love2d can not use the ESC or CTRL key, we can not launch the Editor. So I add some ugly code directly in the function love.touchpressed(), it can launch the Editor on iOS, see below:

function love.touchpressed()
    love.keyboard.setTextInput(true)
    touches = love.touch.getTouches()
    for i, id in ipairs(touches) do
        local x, y = love.touch.getPosition(id)
    
        if x <= 100 and y <= 100 then 
             handled = false
            if neko.cart then 
                neko.cart = nil
            elseif editors.opened then 
                editors.close()
            else 
                editors.open()
            end  
    
        end  
    end  
end
@egordorichev
Copy link
Owner

I'm thinking for another solution - on screen controls. They will make you able to use arrows also. What do you think? Another option is to add edit command.

@egordorichev
Copy link
Owner

Or another thing, I probably should do, is implement my own on screen keyboard. Yep, will do that.

@FreeBlues
Copy link
Contributor Author

I think an edit command is much better than my temporary code! The logic can keep clear.

@egordorichev
Copy link
Owner

The only thing is, you won't be able to exit 😆

@FreeBlues
Copy link
Contributor Author

FreeBlues commented Sep 9, 2017

We can add an button icon on top of editor like other sprite/music.. icons, click it will exit.

I will try to finish it, wait a few minutes...

@egordorichev
Copy link
Owner

Added that in the latest commit, be sure to pull again.

screenshot from 2017-09-09 18-51-43

But again, this is tmp.

@FreeBlues
Copy link
Contributor Author

Good job! I only finished to add the command edit.

@FreeBlues
Copy link
Contributor Author

It works very well on mac and iOS, but a strange thing ,on my mac and iPad, the exit icon can not see.

@egordorichev
Copy link
Owner

egordorichev commented Sep 9, 2017

Hmm, try to replace it's position in editors/init.lua:94 and editors/init.lua:118 with manual values, for example x = 185, y = 121.

I don't have any mobile devices, so I can't check it, sorry.

@FreeBlues
Copy link
Contributor Author

The close function is ok, only the icon can not display, so we need not change the cords of x and y, they are correct.
I think maybe the No. 13 icon is not exist, because when I change it to 12, then the right bottom corner will show an music icon.

@egordorichev
Copy link
Owner

egordorichev commented Sep 9, 2017

Hm, did you change neko.n8? If so, override it with a new one.
Edit: just type folder and delete neko.n8.

@FreeBlues
Copy link
Contributor Author

Pull it get the message of :

Air:neko8 admin$ git pull
Already up-to-date.
Air:neko8 admin$

Then rm it and clone again, but still no icon...

@egordorichev
Copy link
Owner

Hm, then edit neko.n8 your self, and add icon at slot 13.

@egordorichev
Copy link
Owner

The thing with this is, that neko8 has two save dirs: project root dir and another dir hidden in app data (you can open it with folder command). If you have a file in hidden dir, and in root dir, it will prefer hidden one. Saving saves all files to hidden dir. So if you had edited neko.n8 and it saved to hidden dir, changing one in the root folder wouldn't result in anything. That's weird, and i'm looking for a workaround.

@FreeBlues
Copy link
Contributor Author

I am a newbie of pico-8, so I need to learn what is the slot 13, after get it clear, I will add the icon manually :)

Now I will study the whole code of neko-8 and try to port it to a Raspberry Pi + LCD, then we can get an entity neko-8!

@egordorichev
Copy link
Owner

I recommend you to have a look at this API manual: https://neko250.github.io/pico8-api/ Neko8 doesn't implement all calls just yet and it doesn't support memory at all. But you can look up all available API calls here: https://github.com/egordorichev/neko8/blob/master/main.lua#L1069

@FreeBlues
Copy link
Contributor Author

OK, thanks, I will go to read the docs.

egordorichev pushed a commit that referenced this issue Sep 18, 2017
Merge pull request #21 from FreeBlues/master
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants