Zw0 | 2 Sep 14:11 2014
Picon

Multitouch support for the evdev input module

Hi,

I am currently experimenting with an emulated multitouch device (uinput)
on a Raspberry PI and created a patch that implements multitouch support for
SDL2 using the evdev input module.

For anyone who is interested, the patch can be found in the bug-tracker:
https://bugzilla.libsdl.org/show_bug.cgi?id=2712
Naith | 2 Sep 11:46 2014
Picon

Re: SDL_SetRelativeMouseMode Starting Position

No problem.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
mcc | 2 Sep 04:01 2014
Picon

Limitation of SDL_GetScancodeFromKey?

Hello. I am trying to write a piece of software that supports many different keyboard layouts. In doing this, I have found SDL_GetScancodeFromKey() and SDL_GetKeyFromScancode() invaluable.

I have run into a problem here. I wish to do something when the user presses the key marked with '?'. However, if I call SDL_GetScancodeFromKey, it returns 0/unknown. If I look at the docs

https://wiki.libsdl.org/SDL_Scancode

I find two sections at the bottom, "These physical keys do not have corresponding virtual key values" and "These virtual key values do not have corresponding physical keys". Question mark is on the latter list, since there is no "question mark" key but rather a / key with a question mark.

The thing I am trying to get out of the API here is reasonable-- I want to know what scancode corresponds to the button with a ? printed on it, so I can tell if this button has been pressed. There is no way for me to tell if this has happened-- it's not clear to me if SDLK_QUESTION can ever fire, but surely it will only be if ? is typed, i.e., the appropriate modifier is down. SDL could *get* me this information-- it has access to the OS keyboard layout APIs and, it seems, must be using them if GetScancodeFromKey works at all. It seems to me SDL *ought* to express some interface for getting me this information.

Moreover it seems to me that if SDL says that this is not something it wants to be in the business of providing, this is a significant and problematic limitation because it means the GetXFromY functions for keys are fundamentally only truly useful for the U.S. QWERTY keyboard layout. Consider SDLK_COLON. According to the API, SDLK_COLON "does not have a corresponding physical key". However, on the AZERTY keyboard layout, there is indeed a physical key-- and thus a scancode-- for SDLK_COLON. On the other hand there is *not* a physical key/scancode for slash in AZERTY, yet the API will allow me to convert SDLK_SLASH to and from scancode on an AZERTY keyboard.

Do these issues I am raising make sense, and is this feature (offering scancodes currently corresponding to the currently "virtual" keycodes) something SDL might consider as a feature in a future version?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Naith | 1 Sep 21:29 2014
Picon

Re: SDL_SetRelativeMouseMode Starting Position

What I'm doing when I want to center the mouse pointer in the window and also trap it inside the window is by first using this function:








Code:
         
   SDL_WarpMouseInWindow(TheWindow, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2);



Then I use this function to trap the mouse pointer inside the window:








Code:

   SDL_SetWindowGrab(TheWindow, SDL_TRUE);



Note that the mouse pointer will still be visible when using this function.
If you want to hide the mouse pointer you can use this function to hide it:








Code:

   SDL_ShowCursor(0);



The mouse pointer should, if you've made everything right, be centered and trapped inside the window when you're starting the program.

If you would like to center the mouse pointer all the time even if the mouse is moved, use SDL_WarpMouseInWindow each frame to center the mouse pointer.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Naith | 1 Sep 20:15 2014
Picon

Re: SDL_SetRelativeMouseMode Starting Position

Nothing weird there. So what you want to do is position the mouse pointer in the middle of the window even though you're moving the mouse, like in a FPS game. Correct?
How do you know that the mouse pointer is moved to the upper left corner? The mouse pointer isn't visible when you're using SDL_SetRelativeMouseMode. Is your m_MousePositionX and m_MousePositionY variables telling you this information?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
mr_tawan | 1 Sep 16:57 2014
Picon

Re: event.text.text to utf32

Hi,

Since the event.text.text is null-terminated UTF8 string (char[]), the easiest way would be to use UTF8-CPP library (http://utfcpp.sourceforge.net/). I haven't tried this but that should work well.

Thanks.
Noom
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Naith | 1 Sep 12:57 2014
Picon

Re: SDL_SetRelativeMouseMode Starting Position

Weird. May I see your code that's creating the window, handling mouse events and stuff?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
ancientcc | 1 Sep 12:26 2014
Picon

SDL 1.2 to 2.0 Migration Guide(Chinese Version)

Last month, I migrate SDL from 1.3 to 2.0. Now migration finished on Windows, iOS and Anrdoid.

 

Duration migrating,  understanding "SDL 1.2 to 2.0 Migration Guide" is important, and I translate to Chinese, holp to befinit for sombody.

 

http://www.freeors.com/bbs/forum.php?mod=viewthread&tid=22149&extra=page%3D1

_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Limanima | 30 Aug 22:48 2014
Picon

iOS crash in SDL_ukitopenglview->swapBuffers -EXC_BAD_ACCESS

Sometimes method SDL_ukitopenglview.swapBuffers was crashing on me, and I didn't knew when.
Now I can reproduce the problem, it seems like a bug, not sure.

I'm opening the itunes app store from my game, and everytime I do this, swapBuffers crashes with EXC_BAD_ACCESS.

This is how I'm opening the store:

[[UIApplication sharedApplication] openURL:nsURL];

Where nsURL is "itms-apps://itunes.apple.com/app/XXXX"
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
MrTAToad | 30 Aug 00:19 2014

Re: pixel from SDL_Texture

Unfortunately not - you can only get pixel data from a surface...

What I do in my engine is load and store the graphic and also convert it to a texture - then I can access the data and do hardware rendering.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Naith | 28 Aug 19:58 2014
Picon

Re: SDL_SetRelativeMouseMode Starting Position

By using this function, the mouse cursor will be positioned at the center of the window at program start:








Code:

// Make sure that the mouse cursor is centered in the window at program start
SDL_WarpMouseInWindow(m_pWindow, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2);


Note that I'm using two defines named WINDOW_WIDTH and WINDOW_HEIGHT so just create two defines named like those or just write the window width and window height instead of the define's.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Gmane