in Education by
First, yes I know about this question, but I'm looking for a bit more information that that. I have actually, a fairly similar problem, in that I need to be able to capture input for mouse/keyboard/joystick, and I'd also like to avoid SDL if at all possible. I was more or less wondering if anyone knows where I can get some decent primers on handling input from devices in Linux, perhaps even some tutorials. SDL works great for cross-platform input handling, but I'm not going to be using anything else at all from SDL, so I'd like to cut it out altogether. Suggestion, comments, and help are all appreciated. Thanks! Edit for clarity: The point is to capture mouse motion, keyboard press/release, mouse clicks, and potentially joystick handling for a game. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Using the link below look at the function void kGUISystemX::Loop(void) This is my main loop for getting input via keyboard and mouse using X Windows on Linux. http://code.google.com/p/kgui/source/browse/trunk/kguilinux.cpp Here is a snippet: if(XPending(m_display)) { XNextEvent(m_display, &m_e); switch(m_e.type) { case MotionNotify: m_mousex=m_e.xmotion.x; m_mousey=m_e.xmotion.y; break; case ButtonPress: switch(m_e.xbutton.button) { case Button1: m_mouseleft=true; break; case Button3: m_mouseright=true; break; case Button4:/* middle mouse wheel moved */ m_mousewheel=1; break; case Button5:/* middle mouse wheel moved */ m_mousewheel=-1; break; } break; case ButtonRelease: switch(m_e.xbutton.button) { case Button1: m_mouseleft=false; break; case Button3: m_mouseright=false; break; } break; case KeyPress: { XKeyEvent *ke; int ks; int key; ke=&m_e.xkey; kGUI::SetKeyShift((ke->state&ShiftMask)!=0); kGUI::SetKeyControl((ke->state&ControlMask)!=0); ks=XLookupKeysym(ke,(ke->state&ShiftMask)?1:0); ......

Related questions

0 votes
    I use libudev to monitor storage devices (usb keys, etc) so that when they are modified I get a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 15, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    _________ package provides basic functionalities in R environment like arithmetic calculations, input/output. (a) R ... R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    In a simple linear regression model (One independent variable), If we change the input variable by 1 unit. How ... of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    Which capturing group can represent the entire expression? (a) group * (b) group 0 (c) group * or ... Regular Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    groupCount reports a total number of Capturing groups. (a) True (b) False I had been asked this question ... Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which capturing group can represent the entire expression? (a) group * (b) group 0 (c) group * ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    groupCount reports a total number of Capturing groups. (a) True (b) False I had been asked this ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is the function used to stop capturing the ad hoc timing ? (a) stopadhoc() (b) stopTimer() ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    The process of capturing the inference process as Single Inference Rule is known as: Clauses Ponens Generalized Modus Ponens Variables...
asked Mar 8, 2021 in Technology by JackTerrance
0 votes
    I am working on a C++ program, which uses cURL library, which is written in plain C. When I try ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Aug 1, 2022 in Education by JackTerrance
0 votes
    I am writing a program that uses the XGetPixel() method. However, upon using it I get an error ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 27, 2022 in Education by JackTerrance
...