SDL and XServer

Hi all,

I’m trying to run a SDL application in an embedded enviroment,
where the X-server has no window manager. My app uses OpenGL and
it’s running in fullscreen and the video is opened with this flags:

// Calculate video flags.
m_videoflags = SDL_OPENGL|SDL_DOUBLEBUF|SDL_FULLSCREEN|SDL_HWSURFACE;

The mouse and video are working properly but I have a problem: I don’t
get the keyboard events in my app, it’s like the keyboard focus is on
other window (there are some internal X11 windows created by SDL). The
same app in my workstation with the KDE and so on, is working ok, then
I think is some thing related to the window management.

I’ve tried the next code with no luck. Anybody knows how to get
keyboard events ?

Thanks,
Jorge

//-----------------------------------------------------------------------------
//! Helper function to activate the window.
//
static void ScreenActivate()
{
SDL_SysWMinfo wm;

// Get window info.
SDL_VERSION( &wm.version );
SDL_GetWMInfo( &wm );

// Lock to display access.
wm.info.x11.lock_func();

// Show the window on top.
XMapRaised( wm.info.x11.display, wm.info.x11.wmwindow );

// Set the focus on it.
XSetInputFocus( wm.info.x11.display, wm.info.x11.wmwindow,
RevertToParent, CurrentTime );

wm.info.x11.unlock_func();
}

Aviso de Confidencialidad de E-mail La informaci?n incluida en el presente
correo electr?nico es CONFIDENCIAL, siendo de uso exclusivo para el
destinatario arriba mencionado. Si Ud. lee este mensaje y no es el
destinatario al que va dirigido o el agente, empleado responsable de
entrega del mensaje al destinatario; le informamos que est? prohibida
cualquier divulgaci?n, distribuci?n o reproducci?n de cualquier modo y le
rogamos que se nos notifique y devuelva el mensaje a la direcci?n de
origen, procediendo a continuaci?n a su
eliminaci?n.--------------------------------------------------------------------------------------------------------------------------------------------------------Confidentiality
E-mail Warning The information included in this electronic mail is
CONFIDENTIAL, being for of exclusive use for the recipient mentioned. If
you read this message and he/she is not the recipient to whon is directed
neither the agent, employee responsible for delivery of the message to the
addressee; we inform you that it is forbidden any distribution or
reproduction by any means and we request you to notified and return the
message to the sender, proceeding after that to delet it.

I think (if memory serves me well) that when using X, the keyboard
handler is built into the X-server. It’s possible that your X isn’t
loading the required server to handle the input. I may be way off, but
I’d look into what all subsystems X loads under normal circumstances,
and see if there is an independent keyboard input server. (Like gpm for
console mouse interaction) Hope you find the issue, and hope that my
guess helps. :slight_smile:

-Elden

jorgefm at cirsa.com wrote:> Hi all,

I’m trying to run a SDL application in an embedded enviroment,
where the X-server has no window manager. My app uses OpenGL and
it’s running in fullscreen and the video is opened with this flags:

// Calculate video flags.
m_videoflags = SDL_OPENGL|SDL_DOUBLEBUF|SDL_FULLSCREEN|SDL_HWSURFACE;

The mouse and video are working properly but I have a problem: I don’t
get the keyboard events in my app, it’s like the keyboard focus is on
other window (there are some internal X11 windows created by SDL). The
same app in my workstation with the KDE and so on, is working ok, then
I think is some thing related to the window management.

I’ve tried the next code with no luck. Anybody knows how to get
keyboard events ?

Thanks,
Jorge

//-----------------------------------------------------------------------------
//! Helper function to activate the window.
//
static void ScreenActivate()
{
SDL_SysWMinfo wm;

// Get window info.
SDL_VERSION( &wm.version );
SDL_GetWMInfo( &wm );

// Lock to display access.
wm.info.x11.lock_func();

// Show the window on top.
XMapRaised( wm.info.x11.display, wm.info.x11.wmwindow );

// Set the focus on it.
XSetInputFocus( wm.info.x11.display, wm.info.x11.wmwindow,
RevertToParent, CurrentTime );

wm.info.x11.unlock_func();
}

Aviso de Confidencialidad de E-mail La informaci?n incluida en el
presente correo electr?nico es CONFIDENCIAL, siendo de uso exclusivo
para el destinatario arriba mencionado. Si Ud. lee este mensaje y no
es el destinatario al que va dirigido o el agente, empleado
responsable de entrega del mensaje al destinatario; le informamos que
est? prohibida cualquier divulgaci?n, distribuci?n o reproducci?n de
cualquier modo y le rogamos que se nos notifique y devuelva el mensaje
a la direcci?n de origen, procediendo a continuaci?n a su
eliminaci?n.--------------------------------------------------------------------------------------------------------------------------------------------------------Confidentiality
E-mail Warning The information included in this electronic mail is
CONFIDENTIAL, being for of exclusive use for the recipient mentioned.
If you read this message and he/she is not the recipient to whon is
directed neither the agent, employee responsible for delivery of the
message to the addressee; we inform you that it is forbidden any
distribution or reproduction by any means and we request you to
notified and return the message to the sender, proceeding after that
to delet it.



SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.7/112 - Release Date: 9/26/2005

Yes, your memory serves you well :slight_smile: It was a problem configuring
X-server. Now, it’s working.

Thanks!
Jorge

I think (if memory serves me well) that when using X, the keyboard
handler is built into the X-server. It’s possible that your X isn’t
loading the required server to handle the input. I may be way off, but
I’d look into what all subsystems X loads under normal circumstances,
and see if there is an independent keyboard input server. (Like gpm for
console mouse interaction) Hope you find the issue, and hope that my
guess helps. :slight_smile:

-Elden

@Jorge_Fernandez_Mont wrote:

Hi all,

I’m trying to run a SDL application in an embedded enviroment,
where the X-server has no window manager. My app uses OpenGL and
it’s running in fullscreen and the video is opened with this flags:

// Calculate video flags.
m_videoflags = SDL_OPENGL|SDL_DOUBLEBUF|SDL_FULLSCREEN|SDL_HWSURFACE;

The mouse and video are working properly but I have a problem: I don’t
get the keyboard events in my app, it’s like the keyboard focus is on
other window (there are some internal X11 windows created by SDL). The
same app in my workstation with the KDE and so on, is working ok, then
I think is some thing related to the window management.

I’ve tried the next code with no luck. Anybody knows how to get
keyboard events ?

Thanks,
Jorge

//-----------------------------------------------------------------------------> > //! Helper function to activate the window.

//
static void ScreenActivate()
{
SDL_SysWMinfo wm;

// Get window info.
SDL_VERSION( &wm.version );
SDL_GetWMInfo( &wm );

// Lock to display access.
wm.info.x11.lock_func();

// Show the window on top.
XMapRaised( wm.info.x11.display, wm.info.x11.wmwindow );

// Set the focus on it.
XSetInputFocus( wm.info.x11.display, wm.info.x11.wmwindow,
RevertToParent, CurrentTime );

wm.info.x11.unlock_func();
}

Aviso de Confidencialidad de E-mail La informaci?n incluida en el
presente correo electr?nico es CONFIDENCIAL, siendo de uso exclusivo
para el destinatario arriba mencionado. Si Ud. lee este mensaje y no
es el destinatario al que va dirigido o el agente, empleado
responsable de entrega del mensaje al destinatario; le informamos que
est? prohibida cualquier divulgaci?n, distribuci?n o reproducci?n de
cualquier modo y le rogamos que se nos notifique y devuelva el mensaje
a la direcci?n de origen, procediendo a continuaci?n a su
eliminaci?n.


Confidentiality

E-mail Warning The information included in this electronic mail is
CONFIDENTIAL, being for of exclusive use for the recipient mentioned.
If you read this message and he/she is not the recipient to whon is
directed neither the agent, employee responsible for delivery of the
message to the addressee; we inform you that it is forbidden any
distribution or reproduction by any means and we request you to
notified and return the message to the sender, proceeding after that
to delet it.



SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.7/112 - Release Date:
9/26/2005


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Glad to hear it! Best of luck.

-Elden

jorgefm at cirsa.com wrote:> Yes, your memory serves you well :slight_smile: It was a problem configuring

X-server. Now, it’s working.

Thanks!
Jorge

I think (if memory serves me well) that when using X, the keyboard
handler is built into the X-server. It’s possible that your X isn’t
loading the required server to handle the input. I may be way off, but
I’d look into what all subsystems X loads under normal circumstances,
and see if there is an independent keyboard input server. (Like gpm for
console mouse interaction) Hope you find the issue, and hope that my
guess helps. :slight_smile:

-Elden

jorgefm at cirsa.com wrote:

Hi all,

I’m trying to run a SDL application in an embedded enviroment,
where the X-server has no window manager. My app uses OpenGL and
it’s running in fullscreen and the video is opened with this flags:

// Calculate video flags.
m_videoflags =
SDL_OPENGL|SDL_DOUBLEBUF|SDL_FULLSCREEN|SDL_HWSURFACE;

The mouse and video are working properly but I have a problem: I don’t
get the keyboard events in my app, it’s like the keyboard focus is on
other window (there are some internal X11 windows created by SDL). The
same app in my workstation with the KDE and so on, is working ok, then
I think is some thing related to the window management.

I’ve tried the next code with no luck. Anybody knows how to get
keyboard events ?

Thanks,
Jorge

//-----------------------------------------------------------------------------

//! Helper function to activate the window.
//
static void ScreenActivate()
{
SDL_SysWMinfo wm;

// Get window info.
SDL_VERSION( &wm.version );
SDL_GetWMInfo( &wm );

// Lock to display access.
wm.info.x11.lock_func();

// Show the window on top.
XMapRaised( wm.info.x11.display, wm.info.x11.wmwindow );

// Set the focus on it.
XSetInputFocus( wm.info.x11.display, wm.info.x11.wmwindow,
RevertToParent, CurrentTime );

wm.info.x11.unlock_func();
}

Aviso de Confidencialidad de E-mail La informaci?n incluida en el
presente correo electr?nico es CONFIDENCIAL, siendo de uso exclusivo
para el destinatario arriba mencionado. Si Ud. lee este mensaje y no
es el destinatario al que va dirigido o el agente, empleado
responsable de entrega del mensaje al destinatario; le informamos que
est? prohibida cualquier divulgaci?n, distribuci?n o reproducci?n de
cualquier modo y le rogamos que se nos notifique y devuelva el
mensaje

a la direcci?n de origen, procediendo a continuaci?n a su
eliminaci?n.


Confidentiality

E-mail Warning The information included in this electronic mail is
CONFIDENTIAL, being for of exclusive use for the recipient mentioned.
If you read this message and he/she is not the recipient to whon is
directed neither the agent, employee responsible for delivery of the
message to the addressee; we inform you that it is forbidden any
distribution or reproduction by any means and we request you to
notified and return the message to the sender, proceeding after that
to delet it.



SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.7/112 - Release Date:
9/26/2005


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl



SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.7/112 - Release Date: 9/26/2005