Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sdl_joystickopen(3) [debian man page]

SDL_JoystickOpen(3)						 SDL API Reference					       SDL_JoystickOpen(3)

NAME
SDL_JoystickOpen - Opens a joystick for use. SYNOPSIS
#include "SDL.h" SDL_Joystick *SDL_JoystickOpen(int index); DESCRIPTION
Opens a joystick for use within SDL. The index refers to the N'th joystick in the system. A joystick must be opened before it game be used. RETURN VALUE
Returns a SDL_Joystick structure on success. NULL on failure. EXAMPLES
SDL_Joystick *joy; // Check for joystick if(SDL_NumJoysticks()>0){ // Open joystick joy=SDL_JoystickOpen(0); if(joy) { printf("Opened Joystick 0 "); printf("Name: %s ", SDL_JoystickName(0)); printf("Number of Axes: %d ", SDL_JoystickNumAxes(joy)); printf("Number of Buttons: %d ", SDL_JoystickNumButtons(joy)); printf("Number of Balls: %d ", SDL_JoystickNumBalls(joy)); } else printf("Couldn't open Joystick 0 "); // Close if opened if(SDL_JoystickOpened(0)) SDL_JoystickClose(joy); } SEE ALSO
SDL_JoystickClose SDL
Tue 11 Sep 2001, 23:00 SDL_JoystickOpen(3)

Check Out this Related Man Page

SDL_JoystickOpen(3)						 SDL API Reference					       SDL_JoystickOpen(3)

NAME
SDL_JoystickOpen - Opens a joystick for use. SYNOPSIS
#include "SDL.h" SDL_Joystick *SDL_JoystickOpen(int index); DESCRIPTION
Opens a joystick for use within SDL. The index refers to the N'th joystick in the system. A joystick must be opened before it game be used. RETURN VALUE
Returns a SDL_Joystick structure on success. NULL on failure. EXAMPLES
SDL_Joystick *joy; // Check for joystick if(SDL_NumJoysticks()>0){ // Open joystick joy=SDL_JoystickOpen(0); if(joy) { printf("Opened Joystick 0 "); printf("Name: %s ", SDL_JoystickName(0)); printf("Number of Axes: %d ", SDL_JoystickNumAxes(joy)); printf("Number of Buttons: %d ", SDL_JoystickNumButtons(joy)); printf("Number of Balls: %d ", SDL_JoystickNumBalls(joy)); } else printf("Couldn't open Joystick 0 "); // Close if opened if(SDL_JoystickOpened(0)) SDL_JoystickClose(joy); } SEE ALSO
SDL_JoystickClose SDL
Tue 11 Sep 2001, 23:00 SDL_JoystickOpen(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

the printf command

hello, Im at another part of the program i am writing. Where i think i'm going to need to use the printf command. If anyone can help me figure out the printf layout i would greatly appreicate it. thanks (4 Replies)
Discussion started by: bebop1111116
4 Replies

2. Programming

printf("%c[%d;%df",0x1B,y,x);

Can u tell me how to understand the line below printf("%c[%d;%df",0x1B,y,x); Actually a function is written as void gotoxy(int x,int y) { printf("%c[%d;%df",0x1B,y,x); } I wanted to know that why %c[%d;%df is used.I mean to say why and when [ and ; is used in between %c... (6 Replies)
Discussion started by: brain_full
6 Replies

3. Shell Programming and Scripting

printf question

can you take input from another command and do printf? such as awk '{print $2,$1}' | sort -k1,1 -k2,2 | printf "%-10s,%15s" this does not work.. but there must be a way.. please help me.. thank you. (3 Replies)
Discussion started by: hankooknara
3 Replies

4. UNIX for Dummies Questions & Answers

AwK printf question

Hi, Does anyone know a easy way to printf $3,$4, ... all the way to the last field in the file? I will need to modify $1 and $2 and then printf modified $1 and $2 and the rest of the fields(which are not changed). I know I can use NF as the total number of field. Do I use a for next statement to... (4 Replies)
Discussion started by: whatisthis
4 Replies

5. UNIX for Dummies Questions & Answers

Displaying Number with printf

I am trying to display a number with commas printf "%d\n" 323232 printf "%d\n" 1234567 I want the output to be: 323,232 1,234,567 I tried to change %d to other formats and could find the solution. any idea? (7 Replies)
Discussion started by: ynixon
7 Replies

6. Shell Programming and Scripting

Displaying Number with printf

I am trying to display a number with commas printf "%d\n" 323232 printf "%d\n" 1234567 I want the output to be: 323,232 1,234,567 I tried to change %d to other formats and could find the solution. any idea? (7 Replies)
Discussion started by: ynixon
7 Replies

7. Shell Programming and Scripting

printf issue on Cygwin

Hi all, I am running a simple test on Cygwin and having this problem. Can someone provide me a fix or alternative? #!/bin/ksh data=10 printf "%02s" $data data=A printf "%02s" $data The result should be 10 and 0A But i am getting printf: "%02s": invalid conversion specification... (4 Replies)
Discussion started by: jakSun8
4 Replies

8. Shell Programming and Scripting

[bash]printf octal instead of decimal

Hello everybody, I would like to understand why the printf function is returning me an octal value with this command : printf %4.4d 0010 returns 0008 printf %4.4d 10 returns 0010 Thanks for help. (3 Replies)
Discussion started by: dolphin06
3 Replies

9. UNIX for Dummies Questions & Answers

printf formatting

Is there a way to make these 2 numbers - $482477.37 and $1875000.00 look like $482,477.37 and $1,875,000.00 with printf? (4 Replies)
Discussion started by: nickg
4 Replies

10. Programming

Internals of the printf function?

hey all, im a new programmer. i was wondering how you would go about writing the printf function yourself? it is my understanding that when you call printf you are calling an already written function and just providing an argument? if this is the case, is it possible to write that function... (8 Replies)
Discussion started by: Christian.B
8 Replies

11. Shell Programming and Scripting

No Syntax Error and No Output

Hello All, this script should use the command who, to log the Full Name, Date, and IP Address of the users who are connected to the system in a file called logfile. Excluding the user running the script. the output in the log file is also sorted, id like to think my scripting is logical, but... (15 Replies)
Discussion started by: ibzee33
15 Replies

12. Shell Programming and Scripting

printf Hexadecimal output

printf "%X\n" "A" 41 printf "%X\n" "2" 2 Expected 32 (not 2). Is there a "printf" which will output the hexadecimal value of a numeric character? (9 Replies)
Discussion started by: methyl
9 Replies

13. Shell Programming and Scripting

awk printf format in columns

Hi all, i have written this script: awk -F';' ' BEGIN { printf "\n" printf "\n" printf "\n" printf "----------------------------------------------\n" print " For test " printf "----------------------------------------------\n" test_200 = 0 test_300 = 0 test_500 = 0 test_1000 = 0... (11 Replies)
Discussion started by: arrals_vl
11 Replies

14. UNIX for Dummies Questions & Answers

Using printf in bash

printf "%5.5\n" "1234567890" will print 12345 . How do I get it to print 67890 Essentially, I just want the last 5 characters rather than the first 5. (4 Replies)
Discussion started by: lavender
4 Replies

15. UNIX for Advanced & Expert Users

BASH Internal : Replace pattern with string without external command

Morning, I'm trying step up my scripting game .. :rolleyes::confused::D Is there a way to do the replacement with an or without using an external command ? I did try but no joy. var=${var//\(|\)/} #!/bin/bash var="lulus.UbiRwidgets.com (10.1.1.1)" var=${var//\(/}... (5 Replies)
Discussion started by: popeye
5 Replies