Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Keyboard events in c + +

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 03-10-2009
Member
 
Join Date: Apr 2009
Posts: 87
Keyboard events in c + +
  

I would like to recognize keyboards and mouse event, I have tried to include the sdl in my Qt project, but the problem is in the compilation: I'm writing
Code:
C + +  1 	  # include <SDL/SDL.h>
the console gives me during compilation manual for Qt:
Code:
Console  main.cpp: 11:21: SDL / SDL.h: No such file or directory
can someone explain me how to integrate SDL to a Qt project?

Reply With Quote
  #2  
Old 03-10-2009
Member
 
Join Date: May 2008
Posts: 2,290
Re: keyboard events in c + +

Windows Forms provides several options for programmatically simulating mouse and keyboard input.Qt has its own event management,, we must reimplement the methods like:
Code:
      cout << "Press key any key move " << endl;
      cin >> key;
      cout << "You pressed name of key : " << key << endl;
      system("PAUSE");
      return 0;
Reply With Quote
  #3  
Old 03-10-2009
Member
 
Join Date: Jan 2009
Posts: 199
Re: keyboard events in c + +

Code:
 void QCloseEvent (QCloseEvent * event) 
  ( 
     QMessageBox:: information (this, "Closed", "Closing the program!"); 
     event -> accept (); 
  )
You'll find a bunch of methods xx_event to manage all the events. The code will displays a dialog box when you close your window.
Reply With Quote
  #4  
Old 03-10-2009
Member
 
Join Date: Dec 2008
Posts: 177
Re: keyboard events in c + +

You really should use third party libraries. There's definitely no platform-independent way to do it in ANSI C. Signal handling is not the way. Some C++ implementations reimplement the standard input stream seperatly from the C stdin stream.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Keyboard events in c + +"
Thread Thread Starter Forum Replies Last Post
All day events one day out Steadfast Portable Devices 4 13-10-2010 11:22 AM
Why we use Events in JavaScript? Samarth Software Development 5 30-01-2010 08:15 PM
Javascript Keyboard Events In Iframe Henryosa Software Development 5 25-01-2010 01:04 PM
jQuery and several events AZUL Software Development 3 28-09-2009 04:19 PM
EVENTS RECEIVED Deabelos Windows XP Support 5 22-09-2008 03:41 AM


All times are GMT +5.5. The time now is 03:30 PM.