English 中文(简体)
sdl. net 键盘事件未在地表控制上提出
原标题:sdl.net keyboard event not raised on SurfaceControl
  • 时间:2012-05-24 20:58:46
  •  标签:
  • sdl.net

我使用SdlDotNet6.1,

My SurfaceControl WinForm control (pictureBox), i don t receive key up and down events All others events (MouseDown, MouseMotion, Tick) seems working only after call Events.Run() (which lock the thread...)

WinForm事件“PreviewKeyDown”也没有被提及。

I found the SurfaceControl needs the focus to raise these events. I use mySurfaceControl.Select() on MouseMove event to force focus on it.

My problem is the keyboardDown event is not raised on every key... It raised on A-Z Escape NumLock Enter Space F1-12 Pause Home Delete. It NOT raised on Ctrl Shift Tab Return 1-9 1-9(num) arrows symbols. Alt and Alt-Gr is raised as Keys.Menu.

我的Azerty键盘(orry i m French)不是原因,

在 WinForm 事件“ PreviewKeyDown” 中检测到所有密钥, 但 WinForm 事件没有提供预览键...

所以键盘。IsKeyPressed总是返回假的,KeyPresident State总是返回323个假的,但事件是真实的。

I need detect when A-Z are pressed : OK I need detect if Ctrl/Shift/Alt is pressed : NOT OK

有什么想法吗 谢谢

最佳回答

我尝试了 IsInputKey= true( 在预览KeyDownArgs中), 但对于 SDL 事件没有效果 。

In fact, there are KeyDown and KeyUp event in addition of PreviewKeyDown but they are not displayed in properties window (Visual Studio 2010), and these events work. Unlike mouse events, these events need the focus on the control (Control.Select() give the focus).

即使Keyboard State会容易些,

解决了

问题回答

暂无回答




相关问题
sdl. net 键盘事件未在地表控制上提出

我使用 SdlDotNet 6.1, 我喜欢它 :) 我的地表控制 WinForm 控制( 图片框), 我接收不到上下事件的密钥, 所有其它事件( 鼠标向下、 鼠标移动、 滴答) 似乎只起作用...

SDL.NET SDL_Flip() equivalent

SDL has an SDL_Flip() function for swapping screen buffers. What is the equivalent in SDL.NET? There is no Screen.Flip() method.

Colors in SDL acting very weird

I m making a program in SDL.NET, where I need to draw a filled polygon. I figured it might be good to reuse the polygon surface instead of remaking it every time i need to draw, so I make the surface ...

SDL.Net application not working without SDL.NET SDK

I have a game that I have made in C# and it installs and runs as expected under Windows XP. However when I install it on a Windows 7 machine, then it either simply doesn t work (without any error ...

SDL.NET runtime without installation?

With plain old sdl in C i would copy the dlls i need into the exe directory and was able to run without install. Now i am using sdl.net. I tried doing that but had no luck. Not even a clue to what ...

moving SDL video surface

Does anyone know how to move my SDL.net video surface around the screen programtically? Surface videoContext = Video.SetVideoMode(1024, 768, 32, false, false, false, true, true); var a = System....

热门标签