-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sdl: gamecontroller, joystick: Add new bindings for SDL 2.0.6 and 2.0.4 #313
Conversation
JOYSTICK_TYPE_GUITAR = C.SDL_JOYSTICK_TYPE_GUITAR | ||
JOYSTICK_TYPE_DRUM_KIT = C.SDL_JOYSTICK_TYPE_DRUM_KIT | ||
JOYSTICK_TYPE_ARCADE_PAD = C.SDL_JOYSTICK_TYPE_ARCADE_PAD | ||
JOYSTICK_TYPE_THROTTLE = C.SDL_JOYSTICK_TYPE_THROTTLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_TYPE_DANCE_PAD = C.SDL_JOYSTICK_TYPE_DANCE_PAD | ||
JOYSTICK_TYPE_GUITAR = C.SDL_JOYSTICK_TYPE_GUITAR | ||
JOYSTICK_TYPE_DRUM_KIT = C.SDL_JOYSTICK_TYPE_DRUM_KIT | ||
JOYSTICK_TYPE_ARCADE_PAD = C.SDL_JOYSTICK_TYPE_ARCADE_PAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_TYPE_FLIGHT_STICK = C.SDL_JOYSTICK_TYPE_FLIGHT_STICK | ||
JOYSTICK_TYPE_DANCE_PAD = C.SDL_JOYSTICK_TYPE_DANCE_PAD | ||
JOYSTICK_TYPE_GUITAR = C.SDL_JOYSTICK_TYPE_GUITAR | ||
JOYSTICK_TYPE_DRUM_KIT = C.SDL_JOYSTICK_TYPE_DRUM_KIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_TYPE_ARCADE_STICK = C.SDL_JOYSTICK_TYPE_ARCADE_STICK | ||
JOYSTICK_TYPE_FLIGHT_STICK = C.SDL_JOYSTICK_TYPE_FLIGHT_STICK | ||
JOYSTICK_TYPE_DANCE_PAD = C.SDL_JOYSTICK_TYPE_DANCE_PAD | ||
JOYSTICK_TYPE_GUITAR = C.SDL_JOYSTICK_TYPE_GUITAR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_TYPE_WHEEL = C.SDL_JOYSTICK_TYPE_WHEEL | ||
JOYSTICK_TYPE_ARCADE_STICK = C.SDL_JOYSTICK_TYPE_ARCADE_STICK | ||
JOYSTICK_TYPE_FLIGHT_STICK = C.SDL_JOYSTICK_TYPE_FLIGHT_STICK | ||
JOYSTICK_TYPE_DANCE_PAD = C.SDL_JOYSTICK_TYPE_DANCE_PAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_TYPE_GAMECONTROLLER = C.SDL_JOYSTICK_TYPE_GAMECONTROLLER | ||
JOYSTICK_TYPE_WHEEL = C.SDL_JOYSTICK_TYPE_WHEEL | ||
JOYSTICK_TYPE_ARCADE_STICK = C.SDL_JOYSTICK_TYPE_ARCADE_STICK | ||
JOYSTICK_TYPE_FLIGHT_STICK = C.SDL_JOYSTICK_TYPE_FLIGHT_STICK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_TYPE_UNKNOWN = C.SDL_JOYSTICK_TYPE_UNKNOWN | ||
JOYSTICK_TYPE_GAMECONTROLLER = C.SDL_JOYSTICK_TYPE_GAMECONTROLLER | ||
JOYSTICK_TYPE_WHEEL = C.SDL_JOYSTICK_TYPE_WHEEL | ||
JOYSTICK_TYPE_ARCADE_STICK = C.SDL_JOYSTICK_TYPE_ARCADE_STICK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
const ( | ||
JOYSTICK_TYPE_UNKNOWN = C.SDL_JOYSTICK_TYPE_UNKNOWN | ||
JOYSTICK_TYPE_GAMECONTROLLER = C.SDL_JOYSTICK_TYPE_GAMECONTROLLER | ||
JOYSTICK_TYPE_WHEEL = C.SDL_JOYSTICK_TYPE_WHEEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
// Types of a joystick. | ||
const ( | ||
JOYSTICK_TYPE_UNKNOWN = C.SDL_JOYSTICK_TYPE_UNKNOWN | ||
JOYSTICK_TYPE_GAMECONTROLLER = C.SDL_JOYSTICK_TYPE_GAMECONTROLLER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
@@ -18,6 +113,20 @@ const ( | |||
HAT_LEFTDOWN = C.SDL_HAT_LEFTDOWN | |||
) | |||
|
|||
// Types of a joystick. | |||
const ( | |||
JOYSTICK_TYPE_UNKNOWN = C.SDL_JOYSTICK_TYPE_UNKNOWN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
@malashin, you can also take a look at my |
@veeableful, I renamed all getter methods from Should According to https://golang.org/doc/effective_go.html#Getters, they all should be renamed. We lose similarity to original C function names, but it is kinda lost already in many other places. |
@malashin Yeah definitely. You can rename them. I can't claim to know what's best for Go developers so go ahead! |
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM | ||
JOYSTICK_POWER_FULL = C.SDL_JOYSTICK_POWER_FULL | ||
JOYSTICK_POWER_WIRED = C.SDL_JOYSTICK_POWER_WIRED | ||
JOYSTICK_POWER_MAX = C.SDL_JOYSTICK_POWER_MAX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW | ||
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM | ||
JOYSTICK_POWER_FULL = C.SDL_JOYSTICK_POWER_FULL | ||
JOYSTICK_POWER_WIRED = C.SDL_JOYSTICK_POWER_WIRED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY | ||
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW | ||
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM | ||
JOYSTICK_POWER_FULL = C.SDL_JOYSTICK_POWER_FULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN | ||
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY | ||
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW | ||
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
const ( | ||
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN | ||
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY | ||
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
// (https://wiki.libsdl.org/SDL_JoystickPowerLevel) | ||
const ( | ||
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN | ||
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
// An enumeration of battery levels of a joystick. | ||
// (https://wiki.libsdl.org/SDL_JoystickPowerLevel) | ||
const ( | ||
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM | ||
JOYSTICK_POWER_FULL = C.SDL_JOYSTICK_POWER_FULL | ||
JOYSTICK_POWER_WIRED = C.SDL_JOYSTICK_POWER_WIRED | ||
JOYSTICK_POWER_MAX = C.SDL_JOYSTICK_POWER_MAX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW | ||
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM | ||
JOYSTICK_POWER_FULL = C.SDL_JOYSTICK_POWER_FULL | ||
JOYSTICK_POWER_WIRED = C.SDL_JOYSTICK_POWER_WIRED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY | ||
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW | ||
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM | ||
JOYSTICK_POWER_FULL = C.SDL_JOYSTICK_POWER_FULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN | ||
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY | ||
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW | ||
JOYSTICK_POWER_MEDIUM = C.SDL_JOYSTICK_POWER_MEDIUM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
const ( | ||
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN | ||
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY | ||
JOYSTICK_POWER_LOW = C.SDL_JOYSTICK_POWER_LOW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
// (https://wiki.libsdl.org/SDL_JoystickPowerLevel) | ||
const ( | ||
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN | ||
JOYSTICK_POWER_EMPTY = C.SDL_JOYSTICK_POWER_EMPTY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
// An enumeration of battery levels of a joystick. | ||
// (https://wiki.libsdl.org/SDL_JoystickPowerLevel) | ||
const ( | ||
JOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
No description provided.