Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Souris] Comment bouger sa souris de facon logiciel ? en C..
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
apocryphe
n00b
n00b


Joined: 03 Jul 2005
Posts: 59
Location: 78 - Pres de Saint Germain

PostPosted: Sun Nov 27, 2005 1:02 pm    Post subject: [Souris] Comment bouger sa souris de facon logiciel ? en C.. Reply with quote

Bon dimanche a tous

J'aimerai pourvoir emuler le mouvement d' une souris de facon logiciel

j'ai chercher la fonction qui permetai de faire sa en langage C mais je n'ai rien trouver...

si quelqu un sait comment creer un evement de souris / bouger ou simuler un click ( ou de clavier...) je suis preneur ! en C de preference, mais bon n importe quelle solution me conviendra...
_________________
Laptop Dell Inspiron 1520
Intel Core2Duo T7250 - GM965 - 4 Go 667MHz DDR2 - Nvidia 8400 GS (256MiB) - BCM4401- iwlwifi3945 - SD R5C822
~amd64 - GCC 4.4.1 - XFS ahci officiel 2.6.30.4 - Xorg 1.6.2 - kde 4.3 - Nvidia 190.18 - WSXGA+ (1680x1050)
Back to top
View user's profile Send private message
ryo-san
l33t
l33t


Joined: 17 Feb 2005
Posts: 729

PostPosted: Sun Nov 27, 2005 5:24 pm    Post subject: Reply with quote

tire de la faq de Developpez.com

Code:

Comment simuler la fonction kbhit sous Unix ?   
[haut]
auteur : Anomaly
La fonction kbhit() permet, sous Windows, de savoir si une touche est disponible ou non dans le buffer du clavier. La fonction ci dessous fournit le même service sous un environnement de type Unix.

#include <unistd.h>
#include <sys/time.h>

int unix_kbhit(void)
{
   struct timeval tv = { 0, 0 };
   fd_set readfds;

   FD_ZERO(&readfds);
   FD_SET(STDIN_FILENO, &readfds);

   return select(STDIN_FILENO + 1, &readfds, NULL, NULL, &tv) == 1;
}

Les caractères détectés peuvent être lus ensuite par fgets() ou getchar().

Attention, cette fonction ne détectera des caractères tapés que s'ils ont été suivis par Entrée. Pour détecter l'arrivée de caractères dès leur frappe, il faut que le terminal fonctionne en mode brut (Raw) (voir FAQ : Comment faire passer un terminal en mode brut (Raw) sous Unix ? ).


sinon , je pense que si tu cherche du cote de SDL,openGL ou Xorg, cela devrait etre fructueux.
y'au aussi ncurses pour le mode console qui sait gere la souris.


Last edited by ryo-san on Sun Nov 27, 2005 6:21 pm; edited 2 times in total
Back to top
View user's profile Send private message
Saigneur
Apprentice
Apprentice


Joined: 21 Oct 2004
Posts: 277
Location: Evry, Essonne, France (48°35'N, 02°15'E)

PostPosted: Sun Nov 27, 2005 5:43 pm    Post subject: Reply with quote

Salut

Je suppose qu'en écrivant dans /dev/input/mice (mince, j'ai plus le chemin exact en tête et je suis pas chez moi), tu dois pouvoir faire quelque chose... On en a déjà parlé sur ce forum il y a quelques semaines de celà. Bon courage :)
_________________
Tant pis si ça saigne, pourvu que ça rentre.
Back to top
View user's profile Send private message
apocryphe
n00b
n00b


Joined: 03 Jul 2005
Posts: 59
Location: 78 - Pres de Saint Germain

PostPosted: Sun Nov 27, 2005 7:41 pm    Post subject: Reply with quote

merci bien jvais chercher
_________________
Laptop Dell Inspiron 1520
Intel Core2Duo T7250 - GM965 - 4 Go 667MHz DDR2 - Nvidia 8400 GS (256MiB) - BCM4401- iwlwifi3945 - SD R5C822
~amd64 - GCC 4.4.1 - XFS ahci officiel 2.6.30.4 - Xorg 1.6.2 - kde 4.3 - Nvidia 190.18 - WSXGA+ (1680x1050)
Back to top
View user's profile Send private message
bouba331
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2004
Posts: 87
Location: Tours (France)

PostPosted: Sun Nov 27, 2005 11:15 pm    Post subject: Reply with quote

Je ne me souviens plus trop bien mais il me semble qu'il y a une fonction de la Xlib qui permet de faire ça aussi.
http://www.the-labs.com/X11/XLib-Manual/
Bonne chance.
Bouba
Back to top
View user's profile Send private message
apocryphe
n00b
n00b


Joined: 03 Jul 2005
Posts: 59
Location: 78 - Pres de Saint Germain

PostPosted: Mon Nov 28, 2005 1:03 am    Post subject: Reply with quote

merci tu m'a bien aider jcrois... jvais lire sa demain a tete reposer... jai deja vue des truc interessant

bonne nuit a tous
_________________
Laptop Dell Inspiron 1520
Intel Core2Duo T7250 - GM965 - 4 Go 667MHz DDR2 - Nvidia 8400 GS (256MiB) - BCM4401- iwlwifi3945 - SD R5C822
~amd64 - GCC 4.4.1 - XFS ahci officiel 2.6.30.4 - Xorg 1.6.2 - kde 4.3 - Nvidia 190.18 - WSXGA+ (1680x1050)
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Mon Nov 28, 2005 2:58 am    Post subject: Reply with quote

L'extension XTest permet de faire ça.
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3519
Location: Alsace (France)

PostPosted: Mon Nov 28, 2005 7:37 am    Post subject: Reply with quote

Vilain garçon!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum