@@ -20,17 +20,17 @@ import ScreenGrabber 0.1
2020
2121Rectangle {
2222 id: root
23− enabled: false
23+ enabled: true
2424 visible: false
2525 color: "white"
2626 anchors.fill: parent
2727 opacity: 0.0
2828
29+
2930 QtObject {
3031 id: keyState
3132 property bool volumeUpPressed: false
3233 property bool volumeDownPressed: false
33− property bool ignoreKeyPresses: false
3434 property bool ignoreKeyRepeats: false
3535 }
3636
@@ -46,7 +46,7 @@ Rectangle {
4646 }
4747
4848 function onKeyPressed(key) {
49− if (keyState.ignoreKeyPresses || keyState.ignoreKeyRepeats)
49+ if (!enabled || keyState.ignoreKeyRepeats)
5050 return;
5151
5252 if (key == Qt.Key_VolumeUp)
@@ -57,7 +57,6 @@ Rectangle {
5757 if (keyState.volumeDownPressed && keyState.volumeUpPressed) {
5858 // Only take one screenshot if both keys are held
5959 keyState.ignoreKeyRepeats = true;
60− enabled = true;
6160 visible = true;
6261 shutterSound.stop();
6362 shutterSound.play();
@@ -80,7 +79,7 @@ Rectangle {
8079 from: 0.0
8180 to: 1.0
8281 onStopped: {
83− if (enabled && visible) {
82+ if (visible) {
8483 fadeOut.start();
8584 }
8685 }
@@ -91,9 +90,8 @@ Rectangle {
9190 from: 1.0
9291 to: 0.0
9392 onStopped: {
94− if (enabled && visible) {
93+ if (visible) {
9594 screenGrabber.captureAndSave();
96− enabled = false;
9795 visible = false;
9896 }
9997 }