Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool shift = (IsPressed(Keys.LeftShift) || IsPressed(Keys.RightShift));
- bool ctrl = (IsPressed(Keys.LeftControl) || IsPressed(Keys.RightControl));
- bool alt = (IsPressed(Keys.LeftAlt) || IsPressed(Keys.RightAlt));
- //Alphabet, Numbers, Space
- for (int i = 0; i < 26; i++)
- {
- if (IsTapped(Keys.A + i))
- if (shift)
- {
- currentString += (char)('A' + i);
- hasText = true;
- }
- else
- {
- currentString += (char)('a' + i);
- hasText = true;
- }
- if (i <= 9 && (IsTapped(Keys.D0 + i) || IsTapped(Keys.NumPad0 + i)))
- {
- if (!shift)
- {
- currentString += (char)('0' + i);
- hasText = true;
- }
- else if (i == 1)
- {
- currentString += '!';
- hasText = true;
- }
- else if (i == 2)
- {
- currentString += '@';
- hasText = true;
- }
- else if (i == 3)
- {
- currentString += '#';
- hasText = true;
- }
- else if (i == 4)
- {
- currentString += '$';
- hasText = true;
- }
- else if (i == 5)
- {
- currentString += '%';
- hasText = true;
- }
- else if (i == 6)
- {
- currentString += '^';
- hasText = true;
- }
- else if (i == 7)
- {
- currentString += '&';
- hasText = true;
- }
- else if (i == 8)
- {
- currentString += '*';
- hasText = true;
- }
- else if (i == 9)
- {
- currentString += '(';
- hasText = true;
- }
- else if (i == 0)
- {
- currentString += ')';
- hasText = true;
- }
- }
- }
Add Comment
Please, Sign In to add comment