Fix Ctrl+Q keyboard shortcut with case-insensitive key comparison #31

Merged
Copilot merged 2 commits from copilot/fix-control-q-close-issue into main 2025-11-18 09:50:06 -06:00
Copilot commented 2025-11-18 08:45:23 -06:00 (Migrated from github.com)

Ctrl+Q fails to close embedded browsers (e.g., Plex) because browsers report key events inconsistently—some send lowercase 'q', others uppercase 'Q' when modifiers are pressed.

Changes

  • renderer.js: Use case-insensitive comparison for Ctrl+Q and Ctrl+S handlers
  • test_electron.js: Update tests to verify case-insensitive behavior
// Before
if (e.ctrlKey && e.key === 'q') {

// After
if (e.ctrlKey && e.key.toLowerCase() === 'q') {
Original prompt

This section details on the original issue you should resolve

<issue_title>Control+Q does not work when trying to close Plex</issue_title>
<issue_description>Control + Q does not work when trying to close Plex. I have not tested it with other applications yet.

I was unable to close it at all. but When i logged out to reset the application, I saw a javascript error. </issue_description>

Comments on the Issue (you are @copilot in this section)


Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Ctrl+Q fails to close embedded browsers (e.g., Plex) because browsers report key events inconsistently—some send lowercase 'q', others uppercase 'Q' when modifiers are pressed. ## Changes - **renderer.js**: Use case-insensitive comparison for Ctrl+Q and Ctrl+S handlers - **test_electron.js**: Update tests to verify case-insensitive behavior ```javascript // Before if (e.ctrlKey && e.key === 'q') { // After if (e.ctrlKey && e.key.toLowerCase() === 'q') { ``` <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Control+Q does not work when trying to close Plex</issue_title> > <issue_description>Control + Q does not work when trying to close Plex. I have not tested it with other applications yet. > > I was unable to close it at all. but When i logged out to reset the application, I saw a javascript error. </issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes SluberskiHomeLab/castroix#30 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/SluberskiHomeLab/castroix/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
SluberskiHomeLab (Migrated from github.com) reviewed 2025-11-18 08:45:23 -06:00
Sign in to join this conversation.
No description provided.