|
|
@ -1,10 +1,8 @@ |
|
|
|
extern crate ctru; |
|
|
|
use ctru::applets::swkbd::{Button, Swkbd}; |
|
|
|
|
|
|
|
|
|
|
|
use ctru::gfx::Gfx; |
|
|
|
|
|
|
|
use ctru::console::Console; |
|
|
|
use ctru::console::Console; |
|
|
|
|
|
|
|
use ctru::gfx::Gfx; |
|
|
|
use ctru::services::apt::Apt; |
|
|
|
use ctru::services::apt::Apt; |
|
|
|
use ctru::services::hid::{Hid, KeyPad}; |
|
|
|
use ctru::services::hid::{Hid, KeyPad}; |
|
|
|
use ctru::applets::swkbd::{Swkbd, Button}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn main() { |
|
|
|
fn main() { |
|
|
|
ctru::init(); |
|
|
|
ctru::init(); |
|
|
@ -34,10 +32,10 @@ fn main() { |
|
|
|
// Raise the software keyboard. You can perform different actions depending on which
|
|
|
|
// Raise the software keyboard. You can perform different actions depending on which
|
|
|
|
// software button the user pressed
|
|
|
|
// software button the user pressed
|
|
|
|
match keyboard.get_utf8(&mut text) { |
|
|
|
match keyboard.get_utf8(&mut text) { |
|
|
|
Ok(Button::Right) => println!("You entered: {}", text), |
|
|
|
Ok(Button::Right) => println!("You entered: {}", text), |
|
|
|
Ok(Button::Left) => println!("Cancelled"), |
|
|
|
Ok(Button::Left) => println!("Cancelled"), |
|
|
|
Ok(Button::Middle) => println!("How did you even press this?"), |
|
|
|
Ok(Button::Middle) => println!("How did you even press this?"), |
|
|
|
Err(_) => println!("Oh noes, an error happened!"), |
|
|
|
Err(_) => println!("Oh noes, an error happened!"), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|