Mercurial > hg > pub > prymula > com
comparison kopieckreta/src/Actions.java @ 23:489244127359
kopieckreta-0.240903-0
author | Przemyslaw <prymula76@outlook.com> |
---|---|
date | Mon, 01 Apr 2024 07:15:00 +0200 |
parents | 2787f5e749ae |
children |
comparison
equal
deleted
inserted
replaced
22:b0c59d056e73 | 23:489244127359 |
---|---|
21 public void keyPressed(KeyEvent event) { | 21 public void keyPressed(KeyEvent event) { |
22 | 22 |
23 if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('a')) { | 23 if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('a')) { |
24 isThere('a'); | 24 isThere('a'); |
25 } | 25 } |
26 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ą')) { | |
27 isThere('ą'); | |
28 } | |
29 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('w')) { | 26 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('w')) { |
30 isThere('w'); | 27 isThere('w'); |
31 } | 28 } |
32 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('e')) { | 29 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('e')) { |
33 isThere('e'); | 30 isThere('e'); |
34 } | |
35 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ę')) { | |
36 isThere('ę'); | |
37 } | 31 } |
38 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('r')) { | 32 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('r')) { |
39 isThere('r'); | 33 isThere('r'); |
40 } | 34 } |
41 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('t')) { | 35 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('t')) { |
51 isThere('i'); | 45 isThere('i'); |
52 } | 46 } |
53 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('o')) { | 47 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('o')) { |
54 isThere('o'); | 48 isThere('o'); |
55 } | 49 } |
56 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ó')) { | |
57 isThere('ó'); | |
58 } | |
59 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('p')) { | 50 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('p')) { |
60 isThere('p'); | 51 isThere('p'); |
61 } | 52 } |
62 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('s')) { | 53 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('s')) { |
63 isThere('s'); | 54 isThere('s'); |
64 } | |
65 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ś')) { | |
66 isThere('ś'); | |
67 } | 55 } |
68 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('d')) { | 56 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('d')) { |
69 isThere('d'); | 57 isThere('d'); |
70 } | 58 } |
71 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('f')) { | 59 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('f')) { |
84 isThere('k'); | 72 isThere('k'); |
85 } | 73 } |
86 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('l')) { | 74 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('l')) { |
87 isThere('l'); | 75 isThere('l'); |
88 } | 76 } |
89 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ł')) { | |
90 isThere('ł'); | |
91 } | |
92 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('z')) { | 77 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('z')) { |
93 isThere('z'); | 78 isThere('z'); |
94 } | 79 } |
95 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ż')) { | |
96 isThere('ż'); | |
97 } | |
98 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ź')) { | |
99 isThere('ź'); | |
100 } | |
101 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('c')) { | 80 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('c')) { |
102 isThere('c'); | 81 isThere('c'); |
103 } | |
104 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ć')) { | |
105 isThere('ć'); | |
106 } | 82 } |
107 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('b')) { | 83 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('b')) { |
108 isThere('b'); | 84 isThere('b'); |
109 } | 85 } |
110 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('n')) { | 86 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('n')) { |
111 isThere('n'); | 87 isThere('n'); |
112 } | |
113 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('ń')) { | |
114 isThere('ń'); | |
115 } | 88 } |
116 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('m')) { | 89 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('m')) { |
117 isThere('m'); | 90 isThere('m'); |
118 } | 91 } |
119 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('1')) { | 92 else if (event.getExtendedKeyCode() == KeyEvent.getExtendedKeyCodeForChar('1')) { |
139 public String getCheat(){ | 112 public String getCheat(){ |
140 return cheat; | 113 return cheat; |
141 } | 114 } |
142 | 115 |
143 private void isThere(char c){ | 116 private void isThere(char c){ |
144 // Nie wiem czemu od razu nie przekazałem dużej litery... | 117 // Nie wiem czemu od razu nie przekazalem duzej litery... |
145 pressKey=Character.toUpperCase(c); | 118 pressKey=Character.toUpperCase(c); |
146 resetCheat(); | 119 resetCheat(); |
147 } | 120 } |
148 private void hungryCheat(char c){ | 121 private void hungryCheat(char c){ |
149 String s =Character.toString(c); | 122 String s =Character.toString(c); |