Screenshots: Fn+p on every screen (#83)
CI / build (pull_request) Successful in 1m44s
Site / build (pull_request) Successful in 9s

Fn+p saves the screen as it is to /screenshots, as the Shell's `screenshot`
does, from anywhere: text fields, dialogs and the help panel included. The
key never reaches an App.

It refuses on Settings > Debug Console, which shows the token: a picture of
that page is a copy of the token in a file (App::showsSecret). `key shot`
presses it over the consoles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-07 21:39:16 +02:00
co-authored by Claude Opus 5.5
parent 1c9f90f92e
commit 4cdb4c342f
16 changed files with 93 additions and 10 deletions
+17
View File
@@ -231,6 +231,22 @@ void test_fn_h_is_help_in_both_modes() {
}
}
// Issue #83: Fn+p everywhere.
void test_fn_p_is_a_screenshot_in_both_modes() {
for (bool typing : {true, false}) {
KeyMapper m;
m.setTextEntry(typing);
auto ev = press(m, withFn({'p'}));
TEST_ASSERT_EQUAL(1, ev.size());
TEST_ASSERT_EQUAL(static_cast<int>(Key::Screenshot), static_cast<int>(ev[0].key));
release(m);
ev = press(m, chars({'p'}));
TEST_ASSERT_EQUAL(1, ev.size());
TEST_ASSERT_EQUAL(static_cast<int>(Key::Char), static_cast<int>(ev[0].key));
TEST_ASSERT_EQUAL('p', ev[0].ch);
}
}
void test_plain_h_still_types() {
for (bool typing : {true, false}) {
KeyMapper m;
@@ -278,6 +294,7 @@ int main() {
RUN_TEST(test_other_characters_still_type_when_not_typing);
RUN_TEST(test_shifted_arrow_keys_type_their_symbols_when_not_typing);
RUN_TEST(test_fn_h_is_help_in_both_modes);
RUN_TEST(test_fn_p_is_a_screenshot_in_both_modes);
RUN_TEST(test_plain_h_still_types);
RUN_TEST(test_question_mark_is_help_only_when_not_typing);
return UNITY_END();