kaorahi / lizgoban

Leela Zero & KataGo visualizer
GNU General Public License v3.0
169 stars 28 forks source link

Why are keyboard default events disabled? #99

Closed qcgm1978 closed 9 months ago

qcgm1978 commented 9 months ago

I found that many keyboard events are not working in electron applications. The code seems to have disabled the related events, such as copy and paste. Although I tried to change some of the configurations in the code,

item('Copy SGF', 'CmdOrCtrl+Shift+C', () => copy_sgf_to_clipboard(false), true),

the system default Cmd+C,Cmd+V is still not working. Since I need to do copy and paste operations in the devtools frequently, this disabling of the default behavior causes a lot of inconvenience.

kaorahi commented 9 months ago

Hmm, this works for me:

qcgm1978 commented 9 months ago

It doesn't work for me. Maybe I add win.webContents.openDevTools() in main.js. At last I found it need comment out Menu.setApplicationMenu(menu_for_window(win))

update: At last I asked bing chat and know it need config submenu including copy and paste.

const edit_menu = menu('Edit', [
        { role: 'copy' },
        { role: 'paste' },
        ...