|
|
@ -375,21 +375,21 @@ impl SoftwareKeyboard { |
|
|
|
/// # Notes
|
|
|
|
/// # Notes
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// The filter callback will work only for the next time the keyboard is used. After using it once, it must be set again.
|
|
|
|
/// The filter callback will work only for the next time the keyboard is used. After using it once, it must be set again.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// # Example
|
|
|
|
/// # Example
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
/// # let _runner = test_runner::GdbRunner::default();
|
|
|
|
/// # let _runner = test_runner::GdbRunner::default();
|
|
|
|
/// # fn main() {
|
|
|
|
/// # fn main() {
|
|
|
|
/// #
|
|
|
|
/// #
|
|
|
|
/// use ctru::applets::swkbd::{SoftwareKeyboard, CallbackInput};
|
|
|
|
/// use ctru::applets::swkbd::{SoftwareKeyboard, CallbackResult};
|
|
|
|
/// let mut keyboard = SoftwareKeyboard::default();
|
|
|
|
/// let mut keyboard = SoftwareKeyboard::default();
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// keyboard.set_filter_callback(|text| {
|
|
|
|
/// keyboard.set_filter_callback(|text| {
|
|
|
|
/// if text.contains("boo") {
|
|
|
|
/// if text.contains("boo") {
|
|
|
|
/// println!("Ah, you scared me!");
|
|
|
|
/// println!("Ah, you scared me!");
|
|
|
|
/// }
|
|
|
|
/// }
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// (CallbackResult::Ok, None)
|
|
|
|
/// (CallbackResult::Ok, None)
|
|
|
|
/// });
|
|
|
|
/// });
|
|
|
|
/// #
|
|
|
|
/// #
|
|
|
@ -533,9 +533,9 @@ impl SoftwareKeyboard { |
|
|
|
/// Set the 2 custom characters to add to the keyboard while using [`Kind::Numpad`].
|
|
|
|
/// Set the 2 custom characters to add to the keyboard while using [`Kind::Numpad`].
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// These characters will appear in their own buttons right next to the `0` key.
|
|
|
|
/// These characters will appear in their own buttons right next to the `0` key.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// # Notes
|
|
|
|
/// # Notes
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// If `None` is passed as either key, that button will not be shown to the user.
|
|
|
|
/// If `None` is passed as either key, that button will not be shown to the user.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// # Example
|
|
|
|
/// # Example
|
|
|
@ -548,7 +548,7 @@ impl SoftwareKeyboard { |
|
|
|
/// let mut keyboard = SoftwareKeyboard::new(Kind::Numpad, ButtonConfig::LeftRight);
|
|
|
|
/// let mut keyboard = SoftwareKeyboard::new(Kind::Numpad, ButtonConfig::LeftRight);
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// keyboard.set_numpad_keys(Some('#'), Some('.'));
|
|
|
|
/// keyboard.set_numpad_keys(Some('#'), Some('.'));
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// // The right numpad key will not be shown.
|
|
|
|
/// // The right numpad key will not be shown.
|
|
|
|
/// keyboard.set_numpad_keys(Some('!'), None);
|
|
|
|
/// keyboard.set_numpad_keys(Some('!'), None);
|
|
|
|
/// #
|
|
|
|
/// #
|
|
|
@ -678,7 +678,7 @@ impl ParentalLock { |
|
|
|
/// # let apt = Apt::new().unwrap();
|
|
|
|
/// # let apt = Apt::new().unwrap();
|
|
|
|
/// use ctru::applets::swkbd::{ParentalLock, Error};
|
|
|
|
/// use ctru::applets::swkbd::{ParentalLock, Error};
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// let parental_lock = ParentalLock::new();
|
|
|
|
/// let mut parental_lock = ParentalLock::new();
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// match parental_lock.launch(&apt, &gfx) {
|
|
|
|
/// match parental_lock.launch(&apt, &gfx) {
|
|
|
|
/// Ok(_) => println!("You can access parental-only features and settings."),
|
|
|
|
/// Ok(_) => println!("You can access parental-only features and settings."),
|
|
|
|