diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-07-16 16:00:11 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-07-16 16:00:11 +0200 |
| commit | 8848fe6657bed6ee32d8f6ccba9c034edd5f40b0 (patch) | |
| tree | 939536647cc4a558876b249f2819e4a949f76c57 /app/client/modules | |
| parent | 9c4bb1ffc6098ec2ece30695ba4b2814c9db6868 (diff) | |
hsl sliders
Diffstat (limited to 'app/client/modules')
| -rw-r--r-- | app/client/modules/pix2pixhd/views/pix2pixhd.live.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.live.js b/app/client/modules/pix2pixhd/views/pix2pixhd.live.js index 14cb5a6..01bac9e 100644 --- a/app/client/modules/pix2pixhd/views/pix2pixhd.live.js +++ b/app/client/modules/pix2pixhd/views/pix2pixhd.live.js @@ -29,12 +29,31 @@ class Pix2PixHDLive extends Component { this.seek = this.seek.bind(this) this.togglePlaying = this.togglePlaying.bind(this) this.toggleRecording = this.toggleRecording.bind(this) + this.handleKeydown = this.handleKeydown.bind(this) + } + componentWillMount() { + document.addEventListener('keydown', this.handleKeydown) + } + componentWillUnmount() { + document.removeEventListener('keydown', this.handleKeydown) } componentWillUpdate(nextProps) { if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) { this.props.actions.live.list_epochs('pix2pixhd', nextProps.opt.checkpoint_name) } } + handleKeydown(e){ + console.log(e.keyCode) + if (e.altKey || e.ctrlKey || e.metaKey) return + switch (e.keyCode) { + case 27: // esc + e.preventDefault() + this.props.actions.live.set_fullscreen(!this.props.fullscreen) + break + default: + break + } + } changeCheckpoint(field, checkpoint_name){ this.props.actions.live.load_epoch(checkpoint_name, 'latest') } @@ -84,7 +103,7 @@ class Pix2PixHDLive extends Component { } return ( <div className='app centered'> - <Player width={424} height={256} /> + <Player width={424} height={256} fullscreen={this.props.fullscreen} /> <div className='params row'> <div className='column'> <ParamGroup @@ -355,6 +374,7 @@ function timeInSeconds(n){ } const mapStateToProps = state => ({ last_message: state.live.last_message, + fullscreen: state.live.fullscreen, opt: state.live.opt, frame: state.live.frame, checkpoints: state.live.checkpoints, |
