Compare commits
3 Commits
5e8b0e498a
...
5e3149e170
Author | SHA1 | Date | |
---|---|---|---|
|
5e3149e170 | ||
|
2e4aa5ee22 | ||
|
cd57c7378b |
@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
@ -33,12 +34,17 @@ int joy_fd, foo;
|
|||||||
struct js_event js;
|
struct js_event js;
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
unsigned long debut;
|
unsigned long debut;
|
||||||
|
char joy_name[128];
|
||||||
|
|
||||||
if( ( joy_fd = open(joy_device , O_RDONLY)) == -1 ) {
|
if( ( joy_fd = open(joy_device , O_RDONLY)) == -1 ) {
|
||||||
fprintf(stderr, "%s: couldn't open %s\n", __func__, joy_device);
|
fprintf(stderr, "%s: couldn't open %s\n", __func__, joy_device);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ioctl(joy_fd, JSIOCGNAME(sizeof(joy_name)), joy_name) < 0)
|
||||||
|
strncpy(joy_name, "Unknown", sizeof(joy_name));
|
||||||
|
fprintf(stderr, "Name: \"%s\"\n", joy_name);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
foo = read(joy_fd, &js, sizeof(struct js_event));
|
foo = read(joy_fd, &js, sizeof(struct js_event));
|
||||||
if ( ! flag ) {
|
if ( ! flag ) {
|
||||||
|
@ -4,6 +4,23 @@ Pour la plupart de ces logiciels, le bouton 50 est utilisé
|
|||||||
pour demander l'effacement d'un hypothétique écran.
|
pour demander l'effacement d'un hypothétique écran.
|
||||||
Voir [osc-joy](../#osc-joy) pour les détails pratiques.
|
Voir [osc-joy](../#osc-joy) pour les détails pratiques.
|
||||||
|
|
||||||
|
```
|
||||||
|
tth@fubar:~/Devel/gadgets-OSC/generators$ ./lissajous.pl
|
||||||
|
Can't locate Net/OpenSoundControl/Client.pm in @INC
|
||||||
|
(you may need to install the Net::OpenSoundControl::Client module)
|
||||||
|
```
|
||||||
|
|
||||||
|
Oups, que faire ?
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
root@fubar:~# cpan
|
||||||
|
cpan[3]> install Net::OpenSoundControl
|
||||||
|
```
|
||||||
|
|
||||||
|
Et voilà...
|
||||||
|
|
||||||
|
|
||||||
## moresinus.pl
|
## moresinus.pl
|
||||||
|
|
||||||
Options : `-d host:port` et `-v`
|
Options : `-d host:port` et `-v`
|
||||||
|
@ -92,7 +92,7 @@ if (verbosity) {
|
|||||||
lo_address t = lo_address_new(remote_host, remote_port);
|
lo_address t = lo_address_new(remote_host, remote_port);
|
||||||
|
|
||||||
if( ( joy_fd = open(joy_device , O_RDONLY)) == -1 ) {
|
if( ( joy_fd = open(joy_device , O_RDONLY)) == -1 ) {
|
||||||
fprintf(stderr, "Couldn't open %s\n", JOY_DEVICE);
|
fprintf(stderr, "Couldn't open %s\n", joy_device);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user