@@ -183,7 +183,7 @@ pub async fn handle_key_events(
183183 }
184184
185185 // Switch focus
186- KeyCode :: Tab => match app. focused_block {
186+ KeyCode :: Tab | KeyCode :: Char ( 'l' ) => match app. focused_block {
187187 FocusedBlock :: Adapter => {
188188 app. focused_block = FocusedBlock :: PairedDevices ;
189189 app. reset_devices_state ( ) ;
@@ -205,7 +205,7 @@ pub async fn handle_key_events(
205205 _ => { }
206206 } ,
207207
208- KeyCode :: BackTab => match app. focused_block {
208+ KeyCode :: BackTab | KeyCode :: Char ( 'h' ) => match app. focused_block {
209209 FocusedBlock :: Adapter => {
210210 if let Some ( selected_controller) = app. controller_state . selected ( ) {
211211 let controller = & app. controllers [ selected_controller] ;
@@ -228,46 +228,6 @@ pub async fn handle_key_events(
228228 _ => { }
229229 } ,
230230
231- KeyCode :: Char ( 'h' ) => match app. focused_block {
232- FocusedBlock :: Adapter => {
233- if let Some ( selected_controller) = app. controller_state . selected ( ) {
234- let controller = & app. controllers [ selected_controller] ;
235- if controller. new_devices . is_empty ( ) {
236- app. focused_block = FocusedBlock :: PairedDevices ;
237- } else {
238- app. focused_block = FocusedBlock :: NewDevices ;
239- }
240- }
241- }
242- FocusedBlock :: PairedDevices => {
243- app. focused_block = FocusedBlock :: Adapter ;
244- }
245- FocusedBlock :: NewDevices => {
246- app. focused_block = FocusedBlock :: PairedDevices ;
247- app. reset_devices_state ( ) ;
248- }
249- _ => { }
250- } ,
251-
252- KeyCode :: Char ( 'l' ) => match app. focused_block {
253- FocusedBlock :: Adapter => {
254- app. focused_block = FocusedBlock :: PairedDevices ;
255- app. reset_devices_state ( ) ;
256- }
257- FocusedBlock :: PairedDevices => {
258- if let Some ( selected_controller) = app. controller_state . selected ( ) {
259- let controller = & app. controllers [ selected_controller] ;
260- if controller. new_devices . is_empty ( ) {
261- app. focused_block = FocusedBlock :: Adapter ;
262- } else {
263- app. focused_block = FocusedBlock :: NewDevices ;
264- }
265- }
266- }
267- FocusedBlock :: NewDevices => app. focused_block = FocusedBlock :: Adapter ,
268- _ => { }
269- } ,
270-
271231 // scroll down
272232 KeyCode :: Char ( 'j' ) | KeyCode :: Down => match app. focused_block {
273233 FocusedBlock :: Adapter => {
0 commit comments