internal/system/event.go uses key chords in tomo/config
This commit is contained in:
		
							parent
							
								
									b6850ee702
								
							
						
					
					
						commit
						42deb40c2d
					
				| @ -2,6 +2,7 @@ package system | |||||||
| 
 | 
 | ||||||
| import "image" | import "image" | ||||||
| import "git.tebibyte.media/tomo/tomo/input" | import "git.tebibyte.media/tomo/tomo/input" | ||||||
|  | import "git.tebibyte.media/tomo/tomo/config" | ||||||
| 
 | 
 | ||||||
| // TODO: once go v1.23 comes out, replace the explicit iterator calls here with | // TODO: once go v1.23 comes out, replace the explicit iterator calls here with | ||||||
| // range loops | // range loops | ||||||
| @ -39,15 +40,14 @@ func (this *Hierarchy) HandleKeyDown (key input.Key, numberPad bool) { | |||||||
| 	} | 	} | ||||||
| 	if caught { return } | 	if caught { return } | ||||||
| 
 | 
 | ||||||
| 	switch key { | 	switch input.KC(key, this.modifiers) { | ||||||
| 	case input.KeyTab: | 	case config.KeyChordFocusNext:                this.focusNext() | ||||||
| 		if this.modifiers.Shift { | 	case config.KeyChordFocusPrevious:            this.focusPrevious() | ||||||
| 			this.focusPrevious() | 	// TODO: up, down, left, and right should find a box to the top, bottom, | ||||||
| 		} else { | 	// left, and right respectively to move the focus to. we might want to | ||||||
| 			this.focusNext() | 	// have four corresponding key chords in tomo/config. | ||||||
| 		} | 	case input.KC(input.KeyDown, input.ModNone):  this.focusNext() | ||||||
| 	case input.KeyUp:   this.focusPrevious() | 	case input.KC(input.KeyUp,   input.ModNone):  this.focusPrevious() | ||||||
| 	case input.KeyDown: this.focusNext() |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user