-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#10 Replaced Keyboard events. Removed Windows.Forms references.
- Loading branch information
1 parent
e21ce98
commit 2cf55ea
Showing
27 changed files
with
235 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// CivOne | ||
// | ||
// To the extent possible under law, the person who associated CC0 with | ||
// CivOne has waived all copyright and related or neighboring rights | ||
// to CivOne. | ||
// | ||
// You should have received a copy of the CC0 legalcode along with this | ||
// work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | ||
|
||
namespace CivOne.Enums | ||
{ | ||
public enum Key | ||
{ | ||
None, | ||
Character, | ||
F1, | ||
F2, | ||
F3, | ||
F4, | ||
F5, | ||
F6, | ||
F7, | ||
F8, | ||
F9, | ||
F10, | ||
F11, | ||
F12, | ||
Up, | ||
Left, | ||
Right, | ||
Down, | ||
Enter, | ||
Space, | ||
Escape, | ||
Delete, | ||
Backspace, | ||
Other | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// CivOne | ||
// | ||
// To the extent possible under law, the person who associated CC0 with | ||
// CivOne has waived all copyright and related or neighboring rights | ||
// to CivOne. | ||
// | ||
// You should have received a copy of the CC0 legalcode along with this | ||
// work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | ||
|
||
using System; | ||
|
||
namespace CivOne.Enums | ||
{ | ||
[Flags] | ||
public enum KeyModifier | ||
{ | ||
None = 0, | ||
Control = 1, | ||
Alt = 2, | ||
Shift = 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// CivOne | ||
// | ||
// To the extent possible under law, the person who associated CC0 with | ||
// CivOne has waived all copyright and related or neighboring rights | ||
// to CivOne. | ||
// | ||
// You should have received a copy of the CC0 legalcode along with this | ||
// work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | ||
|
||
using System; | ||
using CivOne.Enums; | ||
|
||
namespace CivOne.Events | ||
{ | ||
public class KeyboardEventArgs : EventArgs | ||
{ | ||
public Key Key { get; private set; } | ||
public char KeyChar { get; private set; } | ||
public KeyModifier Modifier { get; private set; } | ||
|
||
public bool Control | ||
{ | ||
get | ||
{ | ||
return (Modifier & KeyModifier.Control) > 0; | ||
} | ||
} | ||
|
||
public bool Alt | ||
{ | ||
get | ||
{ | ||
return (Modifier & KeyModifier.Alt) > 0; | ||
} | ||
} | ||
|
||
public bool Shift | ||
{ | ||
get | ||
{ | ||
return (Modifier & KeyModifier.Shift) > 0; | ||
} | ||
} | ||
|
||
public KeyboardEventArgs(Key key, KeyModifier modifier = KeyModifier.None) | ||
{ | ||
Key = key; | ||
KeyChar = (char)0x00; | ||
Modifier = modifier; | ||
} | ||
|
||
public KeyboardEventArgs(char keyChar, KeyModifier modifier = KeyModifier.None) | ||
{ | ||
Key = Key.Character; | ||
KeyChar = keyChar; | ||
Modifier = modifier; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.