| 2001 | } |
| 2002 | |
| 2003 | static cc_bool KeyBindsScreen_TriggerBinding(int key, struct InputDevice* device) { |
| 2004 | struct KeyBindsScreen* s = &KeyBindsScreen; |
| 2005 | InputBind bind; |
| 2006 | int idx; |
| 2007 | if (device->type != bind_device->type) return false; |
| 2008 | |
| 2009 | Input.DownHook = NULL; |
| 2010 | if (s->curI == -1) return false; |
| 2011 | bind = s->binds[s->curI]; |
| 2012 | |
| 2013 | if (key == device->escapeButton) { |
| 2014 | InputBind_Reset(bind, bind_device); |
| 2015 | } else { |
| 2016 | InputBind_Set(bind, key, bind_device); |
| 2017 | } |
| 2018 | |
| 2019 | idx = s->curI; |
| 2020 | s->curI = -1; |
| 2021 | s->closable = true; |
| 2022 | KeyBindsScreen_Update(s, idx); |
| 2023 | return true; |
| 2024 | } |
| 2025 | |
| 2026 | static void KeyBindsScreen_OnBindingClick(void* screen, void* widget) { |
| 2027 | struct KeyBindsScreen* s = (struct KeyBindsScreen*)screen; |
nothing calls this directly
no test coverage detected