The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL 1.3 and key repeating
Pavel Kanzelsberger
Guest

Hello guys,

I see that SDL_EnableKeyRepeat seems to be deprecated in SDL 1.3, since I can find it only in compatibility layer in SDL_compat.h


Ok anyway it seems to work for TextInput events, but for some other keys that won't push TextInput event but rather KeyboardEvent are ignoring the repeat settings. For example if I hold "A" on my keyboard it starts repeating, but if I hold Left Arrow, it won't.


Should I forget this function at all since it might get deleted from SDL 2 and I need to implement it myself repeating events until key was released?


thanks
---
Pavel Kanzelsberger
http://www.kanzelsberger.com
E-Mail:
Jabber:, ICQ: 20990633
SDL 1.3 and key repeating
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Key repeat is still under evaluation, since it's a case that sort of
breaks the abstraction between key presses and text input events.

Do people have an opinion on whether key repeat should repeat keys or
repeat text?

On Wed, Apr 14, 2010 at 7:26 AM, Pavel Kanzelsberger wrote:
Quote:
Hello guys,
I see that SDL_EnableKeyRepeat seems to be deprecated in SDL 1.3, since I
can find it only in compatibility layer in SDL_compat.h
Ok anyway it seems to work for TextInput events, but for some other keys
that won't push TextInput event but rather KeyboardEvent are ignoring the
repeat settings. For example if I hold "A" on my keyboard it starts
repeating, but if I hold Left Arrow, it won't.
Should I forget this function at all since it might get deleted from SDL 2
and I need to implement it myself repeating events until key was released?
thanks
---
Pavel Kanzelsberger
http://www.kanzelsberger.com
E-Mail:
Jabber:, ICQ: 20990633


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL 1.3 and key repeating
David Olofson
Guest

On Friday 16 April 2010, at 07.34.53, Sam Lantinga wrote:
Quote:
Key repeat is still under evaluation, since it's a case that sort of
breaks the abstraction between key presses and text input events.

Do people have an opinion on whether key repeat should repeat keys or
repeat text?

I think the important thing is that you can tell "real" key events from
repetitions. (So you don't have to disable key repeat to track key state
properly...)

Does repeating keys mean the text is only available in the initial event? If
so, that would force text input code to cache text events to handle repeat,
which seems like complexity in the wrong place to me.


--
//David Olofson - Developer, Artist, Open Source Advocate

.--- Games, examples, libraries, scripting, sound, music, graphics ---.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
'---------------------------------------------------------------------'
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL 1.3 and key repeating
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
I guess the right thing to do is to have key repeat work the
traditional way, where it's handled by the OS, and generates both key
events and possibly text events.

On Thu, Apr 15, 2010 at 11:27 PM, David Olofson wrote:
Quote:
On Friday 16 April 2010, at 07.34.53, Sam Lantinga wrote:
Quote:
Key repeat is still under evaluation, since it's a case that sort of
breaks the abstraction between key presses and text input events.

Do people have an opinion on whether key repeat should repeat keys or
repeat text?

I think the important thing is that you can tell "real" key events from
repetitions. (So you don't have to disable key repeat to track key state
properly...)

Does repeating keys mean the text is only available in the initial event? If
so, that would force text input code to cache text events to handle repeat,
which seems like complexity in the wrong place to me.


--
//David Olofson - Developer, Artist, Open Source Advocate

.--- Games, examples, libraries, scripting, sound, music, graphics ---.
|  http://olofson.net   http://kobodeluxe.com   http://audiality.org  |
|  http://eel.olofson.net  http://zeespace.net   http://reologica.se  |
'---------------------------------------------------------------------'
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL 1.3 and key repeating
Pavel Kanzelsberger
Guest

Hi,

that's a good idea if you leave it for operating system, because they
usually have repeat settings defined by user and it should have same
behaviour as in other apps.

So should I wait for keyrepeat working soon or do I need to implement
it myself using timers?

Pavel

On 16.4.2010, at 7:34, Sam Lantinga wrote:

Quote:
Key repeat is still under evaluation, since it's a case that sort of
breaks the abstraction between key presses and text input events.

Do people have an opinion on whether key repeat should repeat keys or
repeat text?

On Wed, Apr 14, 2010 at 7:26 AM, Pavel Kanzelsberger
Quote:
wrote:
Hello guys,
I see that SDL_EnableKeyRepeat seems to be deprecated in SDL 1.3,
since I
can find it only in compatibility layer in SDL_compat.h
Ok anyway it seems to work for TextInput events, but for some other
keys
that won't push TextInput event but rather KeyboardEvent are
ignoring the
repeat settings. For example if I hold "A" on my keyboard it starts
repeating, but if I hold Left Arrow, it won't.
Should I forget this function at all since it might get deleted
from SDL 2
and I need to implement it myself repeating events until key was
released?
thanks
---
Pavel Kanzelsberger
http://www.kanzelsberger.com
E-Mail:
Jabber:, ICQ: 20990633


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

---
Pavel Kanzelsberger
http://www.kanzelsberger.com
E-Mail:
Jabber:, ICQ: 20990633


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org