diff --git a/drum-machine/public/index.html b/drum-machine/public/index.html index bce8a28..53111f6 100644 --- a/drum-machine/public/index.html +++ b/drum-machine/public/index.html @@ -36,6 +36,5 @@ To begin the development, run `npm start` or `yarn start`. To create a production bundle, use `npm run build` or `yarn build`. --> - diff --git a/drum-machine/src/App.js b/drum-machine/src/App.js index 22b7a52..ca1f938 100644 --- a/drum-machine/src/App.js +++ b/drum-machine/src/App.js @@ -33,7 +33,6 @@ class App extends React.Component { bank: false, volume: 100, displayPanelText: "Drum Machine", - latestKeyPressed: undefined, }; this.updateColors = this.updateColors.bind(this); this.togglePower = this.togglePower.bind(this); @@ -41,24 +40,9 @@ class App extends React.Component { this.handleVolumeChange = this.handleVolumeChange.bind(this); this.toggleBank = this.toggleBank.bind(this); this.displayDrumPadPress = this.displayDrumPadPress.bind(this); - this.handleKeyPresses = this.handleKeyPresses.bind(this); this.updateColors(); } - handleKeyPresses(event) { - this.setState({ - latestKeyPressed: String(event.key).toUpperCase(), - }); - } - - componentDidMount() { - document.addEventListener("keydown", this.handleKeyPresses, false); - } - - componentWillUnmount() { - document.removeEventListener("keydown", this.handleKeyPresses, false); - } - togglePower() { this.setState((state) => ({ power: !state.power, @@ -70,7 +54,6 @@ class App extends React.Component { displayDrumPadPress(note) { this.setState({ displayPanelText: note, - latestKeyPressed: undefined, }); } @@ -128,7 +111,6 @@ class App extends React.Component { drumPadKeys.push( {this.props.drumPadKey}