Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ pub async fn handle_key_events(
FocusedBlock::AccessPointInput => match key_event.code {
KeyCode::Enter => {
ap.start(sender.clone()).await?;
app.focused_block = FocusedBlock::Device;
app.focused_block = FocusedBlock::AccessPoint;
}

KeyCode::Esc => {
Expand Down Expand Up @@ -709,6 +709,20 @@ pub async fn handle_key_events(
_ => {}
},

KeyCode::Char(c) if c == config.ap.start => {
if app.focused_block == FocusedBlock::AccessPoint {
ap.ap_start
.store(true, std::sync::atomic::Ordering::Relaxed);
app.focused_block = FocusedBlock::AccessPointInput;
}
}

KeyCode::Char(c) if c == config.ap.stop => {
if app.focused_block == FocusedBlock::AccessPoint {
ap.stop(sender.clone()).await?;
}
}

_ => {
if app.focused_block == FocusedBlock::Device {
match key_event.code {
Expand Down
3 changes: 3 additions & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ pub fn render(app: &mut App, frame: &mut Frame) {
Mode::Ap => {
if let Some(ap) = &mut app.device.ap {
ap.render(frame, app.focused_block, &device, app.config.clone());
if app.focused_block == FocusedBlock::AccessPointInput {
ap.render_input(frame);
}
}
}
}
Expand Down