Add support for systems without mouse or keyboard
Added nullchecks for love.keyboard and love.mouse for forks of LOVE like LOVEPotion, where keyboard and mouse aren't handled like normal
Arguably, if love.keyboard and love.mouse aren't available, shouldn't we throw an error if somebody tries to use those sources instead of silently doing nothing? Unless you're trying to use the same code for multiple platforms.
Yeah, that's what I'm trying to do
I'd like to add, baton works well with lovepotion (after this nilcheck) and if my changes don't slow down the library significantly, I feel it would be a better option to have it merged rather than maintain a fork for just this purpose
My concern isn't the performance, it's the silent misbehavior. Does LovePotion offer any way to tell that you're running on 3DS at runtime? Because if so, I would just use a different input config depending on the system.
I mean, there are some constants that tell you what console you're running on, but I don't know if "misbehaviour" is the right word. Lovepotion runs only on 3DS and Switch, none of which have a concept of mouse and keyboard, so the love.mouse and love.keyboard APIs were not fully implemented by the developer (love.keyboard is used for the system keyboard like in smartphones, I believe). So what my nilchecks do is just keep the library from crashing on those consoles, because it would just throw a lua error trying to access a method that is nil.