remove usage of e.which (#1196)

* remove usage of e.which

* this comment is no longer necessary
This commit is contained in:
Tropical 2022-06-25 02:34:30 -05:00 committed by GitHub
parent 6c5f9ee49b
commit 085847644c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ export default new class DeveloperMode extends Builtin {
}
debugListener(e) {
if (e.which === 119 || e.which == 118) { // F8
if (e.key === "F7" || e.key == "F8") {
debugger; // eslint-disable-line no-debugger
e.preventDefault();
e.stopImmediatePropagation();

View File

@ -13,7 +13,7 @@ export default new class DevToolsListener extends Builtin {
}
toggleDevTools(e) {
if (e.ctrlKey && e.shiftKey && e.which === 73) { // Ctrl + Shift + I
if (e.ctrlKey && e.shiftKey && e.key === "I") {
e.stopPropagation();
e.preventDefault();
if (this.get(this.collection, this.category, this.id)) IPC.toggleDevTools();

View File

@ -15,7 +15,7 @@ export default new class InspectElement extends Builtin {
}
inspectElement(e) {
if (e.ctrlKey && e.shiftKey && e.which === 67) { // Ctrl + Shift + C
if (e.ctrlKey && e.shiftKey && e.key === "C") { // Ctrl + Shift + C
IPC.inspectElement();
}
}

View File

@ -75,7 +75,7 @@ export default class PublicServers extends React.Component {
}
searchKeyDown(e) {
if (this.state.loading || e.which !== 13) return;
if (this.state.loading || e.key !== "Enter") return;
const term = e.target.value;
if (this.state.tab == "Featured" || this.state.tab == "Popular") this.setState({tab: "All"}, () => this.search(term));
else this.search(term);