Page 1 of 1

Mouse events on WidowedScreen

Posted: Tue Dec 07, 2010 1:00 pm
by scrat
Hello

I try to get mouse events on a widowedscreen with gtk and opengl subsystem
I use this code

Code: Select all

CompilerCase #PB_OS_Linux

  *IdMain.GtkWidget
  *IdMain=WindowID(#Main)
   gdk_window_set_events_(*IdMain\window,#GDK_ALL_EVENTS_MASK)
  g_signal_connect_data_(WindowID(#Main), "button_release_event", @MouseUp(), #Null, #Null, #G_CONNECT_SWAPPED)
  g_signal_connect_data_(WindowID(#Main), "button_press_event", @MouseDown(), #Null, #Null, #G_CONNECT_SWAPPED)  

  CompilerEndSelect  
I get the events on the window around the screen but not on the screen

Any idea without initmouse()

Re: Mouse events on WidowedScreen

Posted: Tue Dec 14, 2010 4:20 am
by GBeebe
I don't know about opengl with gtk, but you can use opengl with sdl:

Screen = SDL_SetVideoMode_(width, height, depth, #SDL_OPENGL | #SDL_HWSURFACE)

Then you can get mouse and keyboards through the SDL_PollEvent