In SDL 2.0, is there no way Accept Key Input in very short Interval?

Hi.

After I Port SDL 1.2 to SDL 2.0, I found there is no SDL_EnableKeyRepeat(1, 1);

I need Repeat Keydown Events. such as Left, Right, Up, Down Arrows and Z,X,C Keys.
and Simultaneous Input. For example, L-SHIFT with ARROWS. or Z with X.

is there no way about I Thoughts in SDL 2.0???

my abstract code implementation here:

while (SDL_PollEvent(&Event))
{
switch (Event.Type)
{
case SDL_KEYDOWN:
switch (Event.key.keysym.sym)
{
case SDLK_LEFT:

break;

}
break;
}
}

After I Port SDL 1.2 to SDL 2.0, I found there is no
SDL_EnableKeyRepeat(1, 1);
[…]
case SDL_KEYDOWN:

switch (Event.key.keysym.sym)

if (Event.key.repeat)
printf(“This was a repeated key\n”);

–ryan.

Just poll normally, and on keydown events, you can check if
SDL_Event::key.repeat is 1 or 0.

-AlexOn Mon, Dec 17, 2012 at 9:20 PM, axt32 wrote:

Hi.

After I Port SDL 1.2 to SDL 2.0, I found there is no
SDL_EnableKeyRepeat(1, 1);

I need Repeat Keydown Events. such as Left, Right, Up, Down Arrows and
Z,X,C Keys.

and Simultaneous Input. For example, L-SHIFT with ARROWS. or Z with X.

is there no way about I Thoughts in SDL 2.0???

my abstract code implementation here:

while (SDL_PollEvent(&Event))

{

switch (Event.Type)

{

case SDL_KEYDOWN:

switch (Event.key.keysym.sym)

{

case SDLK_LEFT:

break;

}

break;

}

}


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

That is because SDL2 uses the system’s repeat rate? It seems for your
purposes that you would want to use key states anyhow via
SDL_GetKeyboardState().

Jonny DOn Mon, Dec 17, 2012 at 9:42 PM, Alex Barry <alex.barry at gmail.com> wrote:

Just poll normally, and on keydown events, you can check if
SDL_Event::key.repeat is 1 or 0.

-Alex

On Mon, Dec 17, 2012 at 9:20 PM, axt32 wrote:

Hi.

After I Port SDL 1.2 to SDL 2.0, I found there is no
SDL_EnableKeyRepeat(1, 1);

I need Repeat Keydown Events. such as Left, Right, Up, Down Arrows and
Z,X,C Keys.

and Simultaneous Input. For example, L-SHIFT with ARROWS. or Z with X.

is there no way about I Thoughts in SDL 2.0???

my abstract code implementation here:

while (SDL_PollEvent(&Event))

{

switch (Event.Type)

{

case SDL_KEYDOWN:

switch (Event.key.keysym.sym)

{

case SDLK_LEFT:

break;

}

break;

}

}


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org