mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
use TuiInput in handlers
This commit is contained in:
parent
d9535b707f
commit
5d00e9f284
11 changed files with 37 additions and 61 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use crate::*;
|
||||
|
||||
impl Handle<Tui> for Mixer<Tui> {
|
||||
fn handle (&mut self, engine: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, engine: &TuiInput) -> Perhaps<bool> {
|
||||
if let TuiEvent::Input(crossterm::event::Event::Key(event)) = engine.event() {
|
||||
|
||||
match event.code {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::*;
|
||||
|
||||
impl Handle<Tui> for Plugin<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Up) => {
|
||||
self.selected = self.selected.saturating_sub(1);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ impl Widget for AddSampleModal {
|
|||
}
|
||||
|
||||
impl Handle<Tui> for AddSampleModal {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
if handle_keymap(self, &from.event(), KEYMAP_ADD_SAMPLE)? {
|
||||
return Ok(Some(true))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::*;
|
||||
impl Handle<Tui> for Sampler {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Up) => {
|
||||
self.cursor.0 = if self.cursor.0 == 0 {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::*;
|
||||
|
||||
impl Handle<Tui> for Track<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
//, NONE, "chain_cursor_up", "move cursor up", || {
|
||||
key!(KeyCode::Up) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue