Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- oldKeyState = keyState;
- keyState = Keyboard.GetState();
- foreach (Keys key in keyState.GetPressedKeys())
- {
- if (oldKeyState.IsKeyUp(key))
- {
- if (key == Keys.Back)
- {
- seed = seed.Remove(seed.Length - 1, 1);
- }
- else if (key == Keys.Enter)
- {
- System.Diagnostics.Trace.WriteLine(seed); // (just do whatever you need with the name
- seed = "";
- }
- else
- {
- seed += key.ToString();
- }
- }
- }
Add Comment
Please, Sign In to add comment