1. Java / Говнокод #10628

    +125

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    // Handle Ctrl-1 ... Ctrl-9 keypresses
    if (!event.isSpecialKey() && event.isControlKey()) {
    	final int code = event.getKeyCode();
    	
    	if (code >= '1' && code <= '9') {
    		// Technically, the keyCode is not the ASCII code and should not
    		// be treated as such. Stupid JavaScript events. However, it
    		// *just so happens* that for number keys these codes match their
    		// ASCII codes. Luckily for us.

    Запостил: someone, 08 Июня 2012

    Комментарии (3) RSS

    Добавить комментарий