Skip to content

Commit

Permalink
Block the browser's shortcut key function when entering shortcut keys…
Browse files Browse the repository at this point in the history
… in the hardware console input box
  • Loading branch information
zhengyangliu committed Jul 3, 2024
1 parent 4b85003 commit 8233794
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/containers/hardware-console.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ class HardwareConsole extends React.Component {
const keyCode = e.keyCode || e.which || e.charCode;
const ctrlKey = e.ctrlKey || e.metaKey;

e.preventDefault();

// Ctrl + A
if (keyCode === 65 && ctrlKey) {
this.writeToPeripheral(String.fromCharCode(1));
Expand Down

0 comments on commit 8233794

Please sign in to comment.