({ control, meta, shift, alt, key } = {})
| 16 | |
| 17 | // Use to convert shortcut to accelerator for electron. |
| 18 | function convertShortcutToAccelerator({ control, meta, shift, alt, key } = {}) { |
| 19 | // Store active modifier keys into an array. |
| 20 | const mods = [ |
| 21 | control && 'Ctrl', |
| 22 | meta && 'Cmd', |
| 23 | shift && 'Shift', |
| 24 | alt && 'Alt', |
| 25 | ].filter(Boolean); // Remove any falsy values |
| 26 | // Get the actual key character and convert to uppercase. |
| 27 | const k = key?.char?.toUpperCase(); |
| 28 | if (!k) return; |
| 29 | // Combine modifiers and key into a single string. |
| 30 | return [...mods, k].join('+'); |
| 31 | } |
| 32 | |
| 33 | // Binds click events to all menu and submenu items recursively. |
| 34 | function bindMenuClicks(pgadminMenus, pgAdminMainScreen) { |
no test coverage detected