Skip to content

Commit

Permalink
Revert "Lutro compat"
Browse files Browse the repository at this point in the history
This reverts commit 0fa704c.
  • Loading branch information
kivutar committed Oct 7, 2022
1 parent 0fa704c commit 819878f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
1 change: 0 additions & 1 deletion input/binds_keyboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var keyBinds = map[glfw.Key]uint32{
glfw.KeyRight: libretro.DeviceIDJoypadRight,
glfw.KeyEnter: libretro.DeviceIDJoypadStart,
glfw.KeyRightShift: libretro.DeviceIDJoypadSelect,
glfw.KeyTab: ActionSwitchPads,
glfw.KeySpace: ActionFastForwardToggle,
glfw.KeyP: ActionMenuToggle,
glfw.KeyF: ActionFullscreenToggle,
Expand Down
10 changes: 2 additions & 8 deletions input/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const (
ActionShouldClose uint32 = lr.DeviceIDJoypadR3 + 3
// ActionFastForwardToggle will run the core as fast as possible
ActionFastForwardToggle uint32 = lr.DeviceIDJoypadR3 + 4
// ActionSwitchPads
ActionSwitchPads uint32 = lr.DeviceIDJoypadR3 + 5
// ActionLast is used for iterating
ActionLast uint32 = lr.DeviceIDJoypadR3 + 6
ActionLast uint32 = lr.DeviceIDJoypadR3 + 5
)

// joystickCallback is triggered when a joypad is plugged.
Expand All @@ -74,8 +72,6 @@ func Init(v *video.Video) {
vid = v
if !glfw.UpdateGamepadMappings(mappings) {
log.Println("Failed to update mappings")
} else {
log.Println("Updated mappings")
}
glfw.SetJoystickCallback(joystickCallback)
}
Expand Down Expand Up @@ -136,13 +132,11 @@ func pollJoypads(state States, analogState AnalogStates) (States, AnalogStates)
return state, analogState
}

var KbdPort int = 0

// pollKeyboard processes keyboard keys
func pollKeyboard(state States) States {
for k, v := range keyBinds {
if vid.Window.GetKey(k) == glfw.Press {
state[KbdPort][v] = 1
state[0][v] = 1
}
}
return state
Expand Down
5 changes: 0 additions & 5 deletions menu/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,6 @@ func (m *Menu) ProcessHotkeys() {
}
}

if input.Released[input.KbdPort][input.ActionSwitchPads] == 1 {
input.KbdPort = (input.KbdPort + 1) % 2
ntf.DisplayAndLog(ntf.Info, "Menu", "Switched pads")
}

// Close if ActionShouldClose is pressed, but display a confirmation dialog
// in case a game is running
if input.Pressed[0][input.ActionShouldClose] == 1 {
Expand Down

0 comments on commit 819878f

Please sign in to comment.