1 25 package org.ofbiz.pos.event; 26 27 import org.ofbiz.pos.screen.PosScreen; 28 import org.ofbiz.pos.component.Input; 29 30 36 public class CharacterEvents { 37 38 public static boolean capsLockSet = false; 39 40 public static void triggerShift(PosScreen pos) { 41 pos.getInput().setFunction("SHIFT"); 42 } 44 45 public static void triggerCaps(PosScreen pos) { 46 capsLockSet = !capsLockSet; 47 } 49 50 public static void triggerDel(PosScreen pos) { 51 pos.getInput().stripLastChar(); 52 } 53 54 public static void triggerA(PosScreen pos) { 55 Input input = pos.getInput(); 56 if (capsLockSet || input.isFunctionSet("SHIFT")) { 57 input.appendChar('A'); 58 } else { 59 input.appendChar('a'); 60 } 61 } 62 63 public static void triggerB(PosScreen pos) { 64 Input input = pos.getInput(); 65 if (capsLockSet || input.isFunctionSet("SHIFT")) { 66 input.appendChar('B'); 67 } else { 68 input.appendChar('b'); 69 } 70 } 71 72 public static void triggerC(PosScreen pos) { 73 Input input = pos.getInput(); 74 if (capsLockSet || input.isFunctionSet("SHIFT")) { 75 input.appendChar('C'); 76 } else { 77 input.appendChar('c'); 78 } 79 } 80 81 public static void triggerD(PosScreen pos) { 82 Input input = pos.getInput(); 83 if (capsLockSet || input.isFunctionSet("SHIFT")) { 84 input.appendChar('D'); 85 } else { 86 input.appendChar('d'); 87 } 88 } 89 90 public static void triggerE(PosScreen pos) { 91 Input input = pos.getInput(); 92 if (capsLockSet || input.isFunctionSet("SHIFT")) { 93 input.appendChar('E'); 94 } else { 95 input.appendChar('e'); 96 } 97 } 98 99 public static void triggerF(PosScreen pos) { 100 Input input = pos.getInput(); 101 if (capsLockSet || input.isFunctionSet("SHIFT")) { 102 input.appendChar('F'); 103 } else { 104 input.appendChar('f'); 105 } 106 } 107 108 public static void triggerG(PosScreen pos) { 109 Input input = pos.getInput(); 110 if (capsLockSet || input.isFunctionSet("SHIFT")) { 111 input.appendChar('G'); 112 } else { 113 input.appendChar('g'); 114 } 115 } 116 117 public static void triggerH(PosScreen pos) { 118 Input input = pos.getInput(); 119 if (capsLockSet || input.isFunctionSet("SHIFT")) { 120 input.appendChar('H'); 121 } else { 122 input.appendChar('h'); 123 } 124 } 125 126 public static void triggerI(PosScreen pos) { 127 Input input = pos.getInput(); 128 if (capsLockSet || input.isFunctionSet("SHIFT")) { 129 input.appendChar('I'); 130 } else { 131 input.appendChar('i'); 132 } 133 } 134 135 public static void triggerJ(PosScreen pos) { 136 Input input = pos.getInput(); 137 if (capsLockSet || input.isFunctionSet("SHIFT")) { 138 input.appendChar('J'); 139 } else { 140 input.appendChar('j'); 141 } 142 } 143 144 public static void triggerK(PosScreen pos) { 145 Input input = pos.getInput(); 146 if (capsLockSet || input.isFunctionSet("SHIFT")) { 147 input.appendChar('K'); 148 } else { 149 input.appendChar('k'); 150 } 151 } 152 153 public static void triggerL(PosScreen pos) { 154 Input input = pos.getInput(); 155 if (capsLockSet || input.isFunctionSet("SHIFT")) { 156 input.appendChar('L'); 157 } else { 158 input.appendChar('l'); 159 } 160 } 161 162 public static void triggerM(PosScreen pos) { 163 Input input = pos.getInput(); 164 if (capsLockSet || input.isFunctionSet("SHIFT")) { 165 input.appendChar('M'); 166 } else { 167 input.appendChar('m'); 168 } 169 } 170 171 public static void triggerN(PosScreen pos) { 172 Input input = pos.getInput(); 173 if (capsLockSet || input.isFunctionSet("SHIFT")) { 174 input.appendChar('N'); 175 } else { 176 input.appendChar('n'); 177 } 178 } 179 180 public static void triggerO(PosScreen pos) { 181 Input input = pos.getInput(); 182 if (capsLockSet || input.isFunctionSet("SHIFT")) { 183 input.appendChar('O'); 184 } else { 185 input.appendChar('o'); 186 } 187 } 188 189 public static void triggerP(PosScreen pos) { 190 Input input = pos.getInput(); 191 if (capsLockSet || input.isFunctionSet("SHIFT")) { 192 input.appendChar('P'); 193 } else { 194 input.appendChar('p'); 195 } 196 } 197 198 public static void triggerQ(PosScreen pos) { 199 Input input = pos.getInput(); 200 if (capsLockSet || input.isFunctionSet("SHIFT")) { 201 input.appendChar('Q'); 202 } else { 203 input.appendChar('q'); 204 } 205 } 206 207 public static void triggerR(PosScreen pos) { 208 Input input = pos.getInput(); 209 if (capsLockSet || input.isFunctionSet("SHIFT")) { 210 input.appendChar('R'); 211 } else { 212 input.appendChar('r'); 213 } 214 } 215 216 public static void triggerS(PosScreen pos) { 217 Input input = pos.getInput(); 218 if (capsLockSet || input.isFunctionSet("SHIFT")) { 219 input.appendChar('S'); 220 } else { 221 input.appendChar('s'); 222 } 223 } 224 225 public static void triggerT(PosScreen pos) { 226 Input input = pos.getInput(); 227 if (capsLockSet || input.isFunctionSet("SHIFT")) { 228 input.appendChar('T'); 229 } else { 230 input.appendChar('t'); 231 } 232 } 233 234 public static void triggerU(PosScreen pos) { 235 Input input = pos.getInput(); 236 if (capsLockSet || input.isFunctionSet("SHIFT")) { 237 input.appendChar('U'); 238 } else { 239 input.appendChar('u'); 240 } 241 } 242 243 public static void triggerV(PosScreen pos) { 244 Input input = pos.getInput(); 245 if (capsLockSet || input.isFunctionSet("SHIFT")) { 246 input.appendChar('V'); 247 } else { 248 input.appendChar('v'); 249 } 250 } 251 252 public static void triggerW(PosScreen pos) { 253 Input input = pos.getInput(); 254 if (capsLockSet || input.isFunctionSet("SHIFT")) { 255 input.appendChar('W'); 256 } else { 257 input.appendChar('w'); 258 } 259 } 260 261 public static void triggerX(PosScreen pos) { 262 Input input = pos.getInput(); 263 if (capsLockSet || input.isFunctionSet("SHIFT")) { 264 input.appendChar('X'); 265 } else { 266 input.appendChar('x'); 267 } 268 } 269 270 public static void triggerY(PosScreen pos) { 271 Input input = pos.getInput(); 272 if (capsLockSet || input.isFunctionSet("SHIFT")) { 273 input.appendChar('Y'); 274 } else { 275 input.appendChar('y'); 276 } 277 } 278 279 public static void triggerZ(PosScreen pos) { 280 Input input = pos.getInput(); 281 if (capsLockSet || input.isFunctionSet("SHIFT")) { 282 input.appendChar('Z'); 283 } else { 284 input.appendChar('z'); 285 } 286 } 287 } 288 | Popular Tags |