diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2023-05-03 21:29:23 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2023-05-03 21:29:23 -0400 |
commit | 96fae9b176c670a2bae04f7f22367e15989e73b3 (patch) | |
tree | 72ad28111d5c53e47dc5a825730bc88e6f7e638f /KeyDetection.java | |
parent | 5bc9eabe409b6908b5d0bd75e24a6b50514020c4 (diff) | |
parent | ff2fa62df5e80f9ef053297afdd65254b5044d60 (diff) | |
download | NPEhero-96fae9b176c670a2bae04f7f22367e15989e73b3.tar.gz NPEhero-96fae9b176c670a2bae04f7f22367e15989e73b3.tar.bz2 NPEhero-96fae9b176c670a2bae04f7f22367e15989e73b3.zip |
Merge branch 'main' of https://gitlab.sowgro.net/guitarheros/guitarhero
Diffstat (limited to 'KeyDetection.java')
-rw-r--r-- | KeyDetection.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/KeyDetection.java b/KeyDetection.java new file mode 100644 index 0000000..98f96e4 --- /dev/null +++ b/KeyDetection.java @@ -0,0 +1,28 @@ +/*Name: + *Date: + *Period: + *Teacher: + *Description: + */ +package cs; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +public class KeyDetection extends AbstractAction +{ + long timeStart = System.currentTimeMillis(); + private char key; + public KeyDetection(char ch){ + key = ch; + } + + public void actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + int time = (int)((System.currentTimeMillis()-timeStart)); + System.out.println(key + ": " + time); + + } + +} |