Hello,
I started developing a game using the LÖVE, but I'm having trouble with the keyboard keys. Some keys are exchanged.
It seems that the Keyboard layout is changed. (I'm from Brazil and the keyboard is different from the U.S.)
The key combinations to insert symbols also does not work, there is already a solution for this? Or I have to manually map the keys?
Sorry my bad English. =(
Keyboard Layout Problem
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Keyboard Layout Problem
Don't know much about keyboards, but if you are using love.keypressed, perhaps you can find the Unicode for the specific keys that aren't working and map that, since keypressed also provides the unicode value of the key.
Re: Keyboard Layout Problem
That's exactly what I did. Working now the keys I needed.MarekkPie wrote:Don't know much about keyboards, but if you are using love.keypressed, perhaps you can find the Unicode for the specific keys that aren't working and map that, since keypressed also provides the unicode value of the key.
Thank you for your help.
Re: Keyboard Layout Problem
I've a similar problem, I'm using Italian Layout on a MacBook Air but it seems that the layout of the keyboard for LOVE is different, maybe American?
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Keyboard Layout Problem
I'm using a hungarian keyboard, and it's the same.
Sadly, with love 0.9.x, keypressed doesn't return the unicode value, so i'm stuck with either the textinput callback, or the restriction that i must only define us layout keys as input. (Note that keyreleased never had an unicode value at all, so wanting to use that is impossible in both cases)
Sadly, with love 0.9.x, keypressed doesn't return the unicode value, so i'm stuck with either the textinput callback, or the restriction that i must only define us layout keys as input. (Note that keyreleased never had an unicode value at all, so wanting to use that is impossible in both cases)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Keyboard Layout Problem
LÖVE relies on SDL for keypressed events. Looking at SDL's Mac-specific source code, it seems to have code to make it use the current keyboard layout for key presses, but maybe it has a bug...
Re: Keyboard Layout Problem
You know, since we're on SDL2 now, we ought to take advantage of this by allowing the developer to distinguish between scancodes and keycodes. That is, the developer could choose whether to have keys map to other layouts either by key position or by letter. This would make localization a lot easier to deal with.
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Keyboard Layout Problem
I think having something like love.keyboard.scancodeToKey(scancode) would be useful, but having both scancodes and keycodes for every key-related operation is probably unnecessary and would make the APIs confusing.
For example, that would let games have default keybinds that correspond to whatever keys are at the positions that represent wasd on an American keyboard no matter what the letters are mapped to (in theory), but it wouldn't let developers accidentally make their games ignore the user's key mappings.
For example, that would let games have default keybinds that correspond to whatever keys are at the positions that represent wasd on an American keyboard no matter what the letters are mapped to (in theory), but it wouldn't let developers accidentally make their games ignore the user's key mappings.
Re: Keyboard Layout Problem
I gave this up a long time ago. There's no way to fix it I believe. I need to keep copying/pasting all the time if I want to use unicode characters like ú, é, è, ã, ñ, etc. Hope we can fix this someday in the future.
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Keyboard Layout Problem
If I'm understanding correctly, you're using the [wiki]love.textinput[/wiki] callback for text input but it's not giving the expected text? Or are you just talking about key presses (that aren't meant to be used for any sort of text input)?megalukes wrote:I gave this up a long time ago. There's no way to fix it I believe. I need to keep copying/pasting all the time if I want to use unicode characters like ú, é, è, ã, ñ, etc. Hope we can fix this someday in the future.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests