From f715fc6eb97ef76b2c86a72d427a568e023103a6 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Fri, 16 Feb 2024 19:30:54 -0700 Subject: [PATCH] Add some comments --- ctru-rs/src/applets/swkbd.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 5098c89..6290e07 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -213,7 +213,8 @@ bitflags! { } } -// Internal book-keeping struct used to send data to `aptSetMessageCallback` when calling the software keyboard +// Internal book-keeping struct used to send data to `aptSetMessageCallback` when calling the software keyboard. +// We only need this because libctru doesn't keep a pointer to the shared memory block in `SwkbdExtra` for whatever reason struct MessageCallbackData { extra: *mut SwkbdExtra, swkbd_shared_mem_ptr: *mut libc::c_void, @@ -855,8 +856,7 @@ impl SoftwareKeyboard { } // A reimplementation of `swkbdMessageCallback` from `libctru/source/applets/swkbd.c`. - // This is only needed because the original function is private to libctru, so we can't - // simply reuse their version + // This function sets up and then calls the callback set by `swkbdSetFilterCallback` #[deny(unsafe_op_in_unsafe_fn)] unsafe extern "C" fn swkbd_message_callback( user: *mut libc::c_void,