AmendHub

Download (as of this amendment):

jcs

/

amend

/

amendments

/

127

util: Add CommandPeriodPressed


jcs made amendment 127 over 2 years ago
--- util.c Sat Mar 4 22:38:09 2023 +++ util.c Thu Jan 11 12:51:22 2024 @@ -1630,6 +1630,21 @@ RestoreHiddenMenuBar(void) DrawMenuBar(); } +bool +CommandPeriodPressed(void) +{ + EventRecord event; + + if (!GetNextEvent(keyDownMask | autoKeyMask, &event)) + return false; + + if ((event.modifiers & cmdKey) && + ((event.message & charCodeMask) == '.')) + return true; + + return false; +} + /* C Extensions */ /* --- util.h Sat Mar 4 22:38:13 2023 +++ util.h Thu Jan 11 12:51:44 2024 @@ -158,6 +158,7 @@ void PasswordDialogFieldFinish(void); pascal void NullCaretHook(void); void HideMenuBar(void); void RestoreHiddenMenuBar(void); +bool CommandPeriodPressed(void); size_t strlcat(char *dst, const char *src, size_t dsize); size_t strlcpy(char *dst, const char *src, size_t dsize);