javispedro
|
2010-02-17
, 17:40
|
|
Posts: 2,355 |
Thanked: 5,249 times |
Joined on Jan 2009
@ Barcelona
|
#21
|
The Following User Says Thank You to javispedro For This Useful Post: | ||
|
2010-02-19
, 02:18
|
Posts: 804 |
Thanked: 1,598 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#22
|
\\swa.event_mask = ExposureMask | PointerMotionMask; swa.event_mask = ExposureMask | PointerMotionMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask;
while (!quit) { XSetInputFocus( x_display, root, RevertToParent, CurrentTime); XSetInputFocus( x_display, win, RevertToParent, CurrentTime); XFlush( x_display ); while(XPending( x_display )) { ...
#include <X11/Xutil.h>
|
2010-02-19
, 10:55
|
Posts: 30 |
Thanked: 16 times |
Joined on Jan 2010
@ Berlin
|
#23
|
I managed to get keyboard working in your example
you need to change:
andCode:\\swa.event_mask = ExposureMask | PointerMotionMask; swa.event_mask = ExposureMask | PointerMotionMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask;
And then the main loop with xev.type will be able to handle: MotionNotify, ButtonPress, ButtonRelease and KeyPress eventsCode:while (!quit) { XSetInputFocus( x_display, root, RevertToParent, CurrentTime); XSetInputFocus( x_display, win, RevertToParent, CurrentTime); XFlush( x_display ); while(XPending( x_display )) { ...
note: you may need to add
after line with X11/Xlib.h , but I'm not sure, my code is a little bit longer at the moment... Can I change this in your code at wiki? do you agree? : ) I've spent 3 days on this silly little problem, but finally solved it, with help of this page (and other pages it links to, and so on) : http://talk.maemo.org/showthread.php?t=36952Code:#include <X11/Xutil.h>
It seems you need to setup this ButtonPressMask and manualy call XSetInputFocus to get keyboard running in X app... I will post in near future very simple code with implemented handling of keyboard, mouse (touchscreen), accelerometer and opengles 2.0, as I'm still working on it it's also very modular, splitted into files like "accelerometer.h", "glinit.h", "glrender.h", etc. ; ) Hope this helps many developers to start developing ( because this whole setup is the hardest part I think... )
|
2010-02-19
, 14:49
|
|
Posts: 2,355 |
Thanked: 5,249 times |
Joined on Jan 2009
@ Barcelona
|
#24
|
Code:while (!quit) { XSetInputFocus( x_display, root, RevertToParent, CurrentTime); XSetInputFocus( x_display, win, RevertToParent, CurrentTime); XFlush( x_display ); while(XPending( x_display )) { ...
|
2010-03-05
, 01:30
|
|
Posts: 2,355 |
Thanked: 5,249 times |
Joined on Jan 2009
@ Barcelona
|
#25
|
SDL_Init(SDL_INIT_VIDEO); SDL_GLES_Init(SDL_GLES_VERSION_2_0); screen = SDL_SetVideoMode(0, 0, 16, SDL_SWSURFACE | SDL_FULLSCREEN); SDL_WM_SetCaption("SimpleGL", "SimpleGL"); SDL_ShowCursor(SDL_DISABLE); context = SDL_GLES_CreateContext(); SDL_GLES_MakeCurrent(context); (start of OpenGL|ES code) glClearColor(0.08, 0.06, 0.07, 1.0); // background color GLuint vertexShader = load_shader(vertex_src, GL_VERTEX_SHADER); // load vertex shader ...
|
2010-03-15
, 10:38
|
Posts: 345 |
Thanked: 467 times |
Joined on Nov 2007
@ Germany
|
#26
|
The library is already available on extras-devel (package name is "libsdl-gles1.2-dev", garage project is "sdlhildon"). For now, best documentation is
Unpacking libsdl-gles1.2-1 (from .../libsdl-gles1.2-1_1.0.0_armel.deb) ... dpkg: error processing /var/cache/apt/archives/libsdl-gles1.2-1_1.0.0_armel.deb (--unpack): trying to overwrite `/opt', which is also in package espeak-data Selecting previously deselected package libsdl-gles1.2-dev.
The Following User Says Thank You to Master of Gizmo For This Useful Post: | ||
|
2010-03-20
, 00:19
|
|
Posts: 2,355 |
Thanked: 5,249 times |
Joined on Jan 2009
@ Barcelona
|
#27
|
Hmm, seems to want to be allowed to exclusively create /opt. Unfortunately espeak does the same:
Nokia-N900-02-8:~# dpkg -l espeak-data libsdl-gles1.2-1 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii espeak-data 1.43.03 eSpeak speech data files ii libsdl-gles1.2 1.0.0 OpenGL|ES library for Simple DirectMedia Lay
|
2010-04-22
, 11:56
|
Posts: 1 |
Thanked: 1 time |
Joined on Apr 2010
|
#28
|
The Following User Says Thank You to JanJordan For This Useful Post: | ||