Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Input events

$
0
0

@cmmart wrote:

Hello! I'm having some trouble with input in MonoGame.

When running a DX build it's easy enough to do:

var form = Win.Control.FromHandle(winHandle);
form.MouseDown += Input_MouseDown;
form.MouseUp += Input_MouseUp;
form.MouseClick += Input_MouseClick;
form.MouseDoubleClick += Input_MouseDoubleClick;
form.MouseMove += Input_MouseMove;
form.MouseWheel += Input_MouseWheel;
form.KeyDown += Input_KeyDown;
form.KeyUp += Input_KeyUp;

To access the input of the actual window. However when running GL (3.5 OpenTK or 3.6 SDL2) I guess those libraries does not use a regular WinForm internally so it does not work. How do you recommend getting input from MonoGame? I cannot use Keyboard.GetState() for my use case since it does not keep up when a user types fast. I need to buffer the input.

I realize

game.Window.TextInput += window_TextInput;

exists but that's only CharEntered. I would need KeyDown, KeyUp, MouseDown etc. as well.

Best regards,
cmmart

Posts: 11

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles