mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 15:49:31 -07:00
Add "Sticky Kiosk" setting that stores "Kiosk" mode when activate
- This setting is important to allow creation ofa Home Screen app on iOS/iPadOS - If kiosk mode is accidentally made sticky, it can be cleared by adding '&kiosk=false` to the URL - Ctrl-K will now also exit kiosk mode This adds a `stickyRead` parameter to settings, that means "read it if it's there, but don't write it"
This commit is contained in:
@@ -349,10 +349,20 @@ const updateFullScreenNavigate = () => {
|
||||
};
|
||||
|
||||
const documentKeydown = (e) => {
|
||||
// don't trigger on ctrl/alt/shift modified key
|
||||
if (e.altKey || e.ctrlKey || e.shiftKey) return false;
|
||||
const { key } = e;
|
||||
|
||||
// Handle Ctrl+K to exit kiosk mode (even when other modifiers would normally be ignored)
|
||||
if (e.ctrlKey && (key === 'k' || key === 'K')) {
|
||||
e.preventDefault();
|
||||
if (settings.kiosk?.value) {
|
||||
settings.kiosk.value = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// don't trigger on ctrl/alt/shift modified key for other shortcuts
|
||||
if (e.altKey || e.ctrlKey || e.shiftKey) return false;
|
||||
|
||||
if (document.fullscreenElement || document.activeElement === document.body) {
|
||||
switch (key) {
|
||||
case ' ': // Space
|
||||
|
||||
Reference in New Issue
Block a user