Commit graph

223 commits

Author SHA1 Message Date
Thomas Altenburger d0efd76edf Invert Y axis on all GamePad 2016-01-08 09:13:26 +01:00
Fraser Waters f0de8333a6 Merge pull request #199 from Frassle/anydown
[Input] Add IsAnyKey/ButtonDown to Keyboard/MouseState.
2015-12-28 00:16:37 +00:00
cra0zy 306b9ff936 Make joystick ID public 2015-12-06 13:43:46 +01:00
Dean Ellis 69e2f36725 Removed NO_SYSDRAWING in favour of just MINUMAL
Reverted changes to GLControl.cs
Updated sln to not build OpenTK.GLControl in MINIMAL mode
2015-08-12 11:56:12 +01:00
Dean Ellis c7e86d467b Fixed MINIMAL and NO_SYSDRAWING compilation 2015-08-12 11:53:20 +01:00
marko 5953907f86 Allowed Mac and Linux to use GamePad. Added Name param to GamePad. Added Xbox 360 Wireless Joystick linux config to GamePadCongifurationDatabase. 2015-01-19 19:04:59 +01:00
Fraser Waters 1ca084cf8a [Input] Add IsAnyKey/ButtonDown/Pressed to input state.
Adds properties to KeyboardState, MouseState, JoystickState and GamePadState
(GamePadButtons), to see if any key or button is down. This should be faster
than iterating over all the public IsDown properties as we can make use of the
internal bit fields.

GamePadButtons uses IsButtonPressed rather than IsButtonDown like the others as
it more closely matches it's current interface (no down methods).
2014-11-27 22:05:33 +01:00
Fraser Waters e855d2eb33 [Input] Legacy keyboard respects the KeyRepeat field.
If the legacy keyboard device receives a key down event with IsRepeat set it
will only raise it's own key down event if it's KeyRepeat field is set to true.

This is as documented, regression casused by refactoring. Fixes issue #201.

Also change the GameWindowState example to show setting of KeyRepeat to true
and false and how that changes the event counts for the legacy and new keyboard
devices.
2014-11-23 14:40:36 +01:00
xThaWolfx 077bf0d65e Update MouseEventArgs.cs
The IsPressed field was never updated as the pressed parameter was never used.
2014-10-13 17:58:47 +02:00
thefiddler 3bf29b074c [Input] Fixed debug display of Back gamepad button 2014-09-18 01:20:21 +02:00
thefiddler 10dd7e8227 [Input] Special-case pre-SDL2.0.4 xinput bindings
Starting with SDL 2.0.4, its xinput bindings are working correctly.
Previous versions would return an invalid zero guid and use incorrect
mapping - this has now been fixed.
2014-09-17 23:48:08 +02:00
thefiddler 71e5a4f4f3 [Input] Add GamePadCapabilities.IsMapped 2014-09-12 08:42:26 +02:00
thefiddler 0735700d50 [Input] Added P880 win32 gamepad configuration 2014-09-11 12:51:50 +02:00
thefiddler bf9f7c9479 [Input] Fixed trigger ToString() 2014-09-11 12:51:50 +02:00
thefiddler 6c2a6336b5 [Input] Added missing Back button in ToString() 2014-09-11 12:51:50 +02:00
thefiddler ec37a9a16d [Input] Do not throw exception on too many axes
A joystick device with more axes/buttons/hats than supported will now
register a warning message instead of throwing an exception.

Fixes an issue with the VMware touch driver, which registers 25 distinct
axes.
2014-09-11 12:51:49 +02:00
thefiddler f81046f27d [Win] Corrected GUID for xinput devices 2014-09-11 12:51:49 +02:00
thefiddler 15a79e5213 [Input] Improved GamePadButtons.ToString() 2014-09-11 12:51:48 +02:00
thefiddler cbb2807959 [Win] Implemented joystick button updates
Due to the way we segregate axes from buttons, the easiest approach is
to retrieve the current button state via HidP_GetUsages().

Axes, buttons and hats are now allocated sequentially based on their
order of appearance in the device capability reports.
2014-09-11 12:51:48 +02:00
thefiddler 131de67459 Fixed minor compilation issues 2014-09-11 12:51:47 +02:00
Stefanos A e38fc0dff7 [Input] Added JoystickCapabilities.SetIsConnected 2014-09-11 12:51:47 +02:00
Stefanos A 14d07a5952 [Win] Corrected XInput Guid in gamepad database
All XInput devices expose the same button layout, so they only need a
single entry in the gamepad configuration database.
2014-09-11 12:51:45 +02:00
thefiddler c6989395df [Input] Added GameWindow.Mouse/Keyboard.GetState()
GameWindow.Mouse/Keyboard hide OpenTK.Input.Mouse/Keyboard.
To simplify usage, the former now provide the same methods
as the latter.
2014-09-11 01:03:24 +02:00
thefiddler e5cd6a3b9e [Input] Implemented JoystickHat GamePad mapping 2014-07-25 23:26:03 +02:00
thefiddler 7c55e4e9ec [Input] Corrected invalid GUID in GamePad database 2014-07-24 01:10:22 +02:00
thefiddler 3e9b2005d1 [Input] Sync GamePad database with SDL 2.0.4 2014-07-24 00:19:41 +02:00
thefiddler 00b531fdef Fixed compilation warnings on Mono 3.4.0 2014-07-21 17:46:39 +02:00
thefiddler 461fbce45f Cleaned up a number of obsolete warnings 2014-07-21 16:39:58 +02:00
thefiddler ead151ea4f Fixed a large number of warnings 2014-07-21 16:03:37 +02:00
thefiddler 340d34b07b [Input] MouseState position is now stored in floating point
Several platforms provide subpixel accuracy for mouse position.
OpenTK can now take advantage of that.
2014-07-16 14:28:27 +02:00
thefiddler 3febb4dda0 [Input] Renamed MouseScrollWheel to MouseScroll
This better describes the functionality of this structure.
2014-05-13 23:25:56 +02:00
thefiddler c6dafbccba [X11] Implemented high-resolution scroll events 2014-05-13 23:23:51 +02:00
thefiddler bb8dfe4304 [Input] Improve SDL2 and Windows GetCursorState 2014-05-12 02:20:52 +02:00
thefiddler f4a3cab0e0 [Input] Added Mouse.GetCursorPos() (WIP) 2014-05-12 02:20:52 +02:00
thefiddler c98b4ea178 [Input] Do not hook FocusedChanged
This is handled by NativeWindowBase now.
2014-05-09 15:23:39 +02:00
thefiddler 8b7d5bc7e4 [Input] Implement key repeat 2014-05-05 00:43:45 +02:00
thefiddler d968281a1b [OpenTK] Refactor keyboard and mouse handling
A lot of duplicated code is now moved to NativeWindowBase and
LegacyInputDriver.
2014-05-04 17:05:08 +02:00
thefiddler 268e8fccde [Input] Removed pointless unsafe region 2014-05-04 17:01:34 +02:00
thefiddler 1096a8802a [Input] Removed pointless ValuePrecise setter 2014-05-04 16:58:59 +02:00
thefiddler 7af710f4dd [Input] Removed pointless MouseDevice.SetState
MouseDevice state should only be modified through its HandleMouse*
methods, not directly.
2014-05-04 16:58:24 +02:00
thefiddler 67359a5d90 [Input] MouseDevice is now based on MouseState
This way we have a single state representation (MouseState), shared by
all mouse APIs and events.
2014-05-04 08:33:20 +02:00
thefiddler 39eb3b1892 [Input] Improved MouseState.ToString() 2014-05-04 08:31:11 +02:00
thefiddler 94fdf1881c [Platform] Improved mouse interface
- The complete mouse state is now available in mouse events
- Horizontal wheels are now supported
- MouseState now takes up less memory and has a simpler internal
implementation.
2014-05-04 01:29:55 +02:00
thefiddler e85377c350 [Platform] Added support for horizontal wheel 2014-05-03 16:47:03 +02:00
thefiddler 3e33ac9280 [Platform] Refactored INativeWindow backends
All INativeWindow implementations are now derived from
NativeWindowBase. They no longer implement legacy IInputDriver
themselves, but rather rely on LegacyInputDriver provided by
NativeWindowBase for compatibility. They also implement the new Mouse*
events.
2014-05-02 16:52:11 +02:00
thefiddler 612652910f [Platform] Inherit NativeWindowBase 2014-05-02 14:18:40 +02:00
thefiddler 24b19d2487 [Input] Added internal MouseDevice.Position getter 2014-05-02 09:37:25 +02:00
thefiddler d03e9d82dc [Input] Fixed key modifiers in KeyboardDevice events 2014-04-27 22:27:18 +02:00
thefiddler 3658fac263 [Input] Use Key.LastKey instead of Enum.GetValues
This avoids unnecessary memory allocations in the KeyboardDevice
constructor.
2014-04-25 14:15:06 +02:00
thefiddler f93d464f62 [Input] JoystickHatState is now IEquatable 2014-03-17 00:30:04 +01:00