source: trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/gui/KeyPressed.java @ 655

Last change on this file since 655 was 655, checked in by pharms, 12 years ago
  • removed old copyright file header
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1package de.ugoe.cs.quest.eventcore.gui;
2
3import de.ugoe.cs.tasktree.keyboardmaps.VirtualKey;
4
5/**
6 * TODO comment
7 *
8 * @version $Revision: $ $Date: $
9 * @author 2011, last modified by $Author: $
10 */
11public class KeyPressed extends KeyInteraction {
12
13    /**  */
14    private static final long serialVersionUID = 1L;
15
16    /**
17     * @param key
18     */
19    public KeyPressed(VirtualKey key) {
20        super(key);
21    }
22
23    /*
24     * (non-Javadoc)
25     *
26     * @see de.harms.attef.userinteraction.Interaction#getName()
27     */
28    public String getName() {
29        return "KeyPressed " + super.getKey();
30    }
31
32    /*
33     * (non-Javadoc)
34     *
35     * @see java.lang.Object#toString()
36     */
37    @Override
38    public String toString() {
39        return "pressing key " + super.getKey();
40    }
41
42    /*
43     * (non-Javadoc)
44     *
45     * @see de.harms.attef.userinteraction.Interaction#startsLogicalSequence()
46     */
47    public boolean startsLogicalSequence() {
48        // TODO handle lock keys correctly
49        return super.getKey().isCombinationKey();
50    }
51
52    /*
53     * (non-Javadoc)
54     *
55     * @see de.harms.attef.userinteraction.Interaction#finishesLogicalSequence()
56     */
57    public boolean finishesLogicalSequence() {
58        return false;
59    }
60
61    /*
62     * (non-Javadoc)
63     *
64     * @see java.lang.Object#equals(java.lang.Object)
65     */
66    @Override
67    public boolean equals(Object other) {
68        if (other instanceof KeyPressed) {
69            return (super.getKey() == ((KeyPressed) other).getKey());
70        }
71        else {
72            return false;
73        }
74    }
75
76    /* (non-Javadoc)
77     * @see java.lang.Object#hashCode()
78     */
79    @Override
80    public int hashCode() {
81        return super.getKey().hashCode();
82    }
83
84}
Note: See TracBrowser for help on using the repository browser.