Can't disable key repeat
Closed this issue · 0 comments
I try to disable key repeat with this code, this is just a template of what I've been doing:
import "dart:io";
import "dart:ffi";
import "package:ffi/ffi.dart";
import "package:sdl2/sdl2.dart";
Pointer window=nullptr;
Pointer event=nullptr;
void main()
{
if (sdlInit(SDL_INIT_EVERYTHING)!=0)
{
exit(1);
}
window=SdlWindowEx.create(title: title,w: width,h: height);
if (window!=nullptr)
{
event=calloc();
}
else
{
exit(1);
}
while(true)
{
event.poll();
if (event.type==SDL_KEYDOWN && event.key.repeat==0)
{
// key is down
}
if (event.type==SDL_KEYUP)
{
// key is up
}
}
}
There doesn't seem to be a way to disable the key repeat like in regular sdl in c or c++ with event.key.repeat==0. It might be called something else, I could not find it in the source code.
Please add this feature.