Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #545 from matrix-org/dbkr/fix_ctrl_e
Browse files Browse the repository at this point in the history
Fix the ctrl+e mute camera shortcut
  • Loading branch information
richvdh committed Nov 8, 2016
2 parents 5a61a1e + a008f50 commit f2222c8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/structures/RoomView.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,18 +358,25 @@ module.exports = React.createClass({
},

onKeyDown: function(ev) {
var handled = false;
let handled = false;
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
let ctrlCmdOnly;
if (isMac) {
ctrlCmdOnly = ev.metaKey && !ev.altKey && !ev.ctrlKey && !ev.shiftKey;
} else {
ctrlCmdOnly = ev.ctrlKey && !ev.altKey && !ev.metaKey && !ev.shiftKey;
}

switch (ev.keyCode) {
case KeyCode.KEY_D:
if (ev.ctrlKey) {
if (ctrlCmdOnly) {
this.onMuteAudioClick();
handled = true;
}
break;

case KeyCode.KEY_E:
if (ev.ctrlKey) {
if (ctrlCmdOnly) {
this.onMuteVideoClick();
handled = true;
}
Expand Down

0 comments on commit f2222c8

Please sign in to comment.