Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 42225 | Differences between
and this patch

Collapse All | Expand All

(-)KeySupport.java (-6 / +28 lines)
Lines 34-45 Link Here
34
		if (key == 0)
34
		if (key == 0)
35
			key = event.keyCode;
35
			key = event.keyCode;
36
		else {
36
		else {
37
			if (0 <= key && key <= 0x1F) {
37
			// Lower range characters might mean that the character is an escape
38
				if ((event.stateMask & SWT.CTRL) != 0 && event.keyCode != event.character)
38
			if (0 <= key && key <= 0x1F) { 
39
					key += 0x40;
39
				if ((event.stateMask & SWT.CTRL) != 0 && event.keyCode != event.character) {
40
			} else {
40
					/* On Windows XP, "Ctrl+Return" is represented as character
41
				if ('a' <= key && key <= 'z')
41
					 * 0x0A and key code 0x0D.  On Linux-GTK, "Ctrl+Return" is
42
					key -= 'a' - 'A';
42
					 * represented as character 0x0D and key code 0x0D.
43
					 */
44
					if ((key == 0x0A) && (event.keyCode != 0x00)) {
45
						key = event.keyCode;
46
					} else if (event.type != SWT.Traverse) {
47
						/* Shift the Ctrl-escaped character from the lower range
48
						 * into the character range.  Note that traversal events are strange.
49
						 */
50
						key += 0x40;
51
					}
52
				}
53
				
54
			} else if ('a' <= key && key <= 'z') {
55
				// Shift lowercase letters to uppercase letters.
56
				key -= 'a' - 'A';
57
				
58
			} else if (((event.stateMask & SWT.CTRL) != 0) && (key == 0x7F)) {
59
				/* On Windows XP, "Ctrl+Backspace" is represented as character
60
				 * 0x7F and key code 0x08.  On Linux-GTK, "Ctrl+Backspace" is
61
				 * is represented as character 0x08 and key code 0x08.
62
				 */
63
				key = event.keyCode;
64
				
43
			}
65
			}
44
		}
66
		}
45
67

Return to bug 42225