Skip to content

Commit

Permalink
Use GLFW pad bindings (#450)
Browse files Browse the repository at this point in the history
* Unhardcode some input vars

* Use GLFW pad mappings

* Remove unused types

* Clean
  • Loading branch information
kivutar authored Jul 17, 2021
1 parent 3d847ae commit ba1b6e4
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 444 deletions.
133 changes: 0 additions & 133 deletions input/binds_darwin.go

This file was deleted.

28 changes: 28 additions & 0 deletions input/binds_joypad.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package input

import (
"github.com/go-gl/glfw/v3.3/glfw"
"github.com/libretro/ludo/libretro"
)

var joyBinds = map[glfw.GamepadButton]uint32{
glfw.ButtonDpadUp: libretro.DeviceIDJoypadUp,
glfw.ButtonDpadDown: libretro.DeviceIDJoypadDown,
glfw.ButtonDpadLeft: libretro.DeviceIDJoypadLeft,
glfw.ButtonDpadRight: libretro.DeviceIDJoypadRight,

glfw.ButtonCircle: libretro.DeviceIDJoypadA,
glfw.ButtonCross: libretro.DeviceIDJoypadB,
glfw.ButtonSquare: libretro.DeviceIDJoypadY,
glfw.ButtonTriangle: libretro.DeviceIDJoypadX,

glfw.ButtonLeftBumper: libretro.DeviceIDJoypadL,
glfw.ButtonRightBumper: libretro.DeviceIDJoypadR,

glfw.ButtonLeftThumb: libretro.DeviceIDJoypadL3,
glfw.ButtonRightThumb: libretro.DeviceIDJoypadR3,

glfw.ButtonStart: libretro.DeviceIDJoypadStart,
glfw.ButtonBack: libretro.DeviceIDJoypadSelect,
glfw.ButtonGuide: ActionMenuToggle,
}
136 changes: 0 additions & 136 deletions input/binds_linux.go

This file was deleted.

Loading

0 comments on commit ba1b6e4

Please sign in to comment.