adb_kbd.c (246e7a2b6494cd991b08ac669ed761ecea0cc98c) | adb_kbd.c (73a1170a8c41cb848f17cc0a8839e9dcee3d126e) |
---|---|
1/*- 2 * Copyright (C) 2008 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 148 unchanged lines hidden (view full) --- 157 /* open, paste, find, cut, audiomute, audiolower, audioraise */ 158 0x64, 0x65, 0x66, 0x67, 0x25, 0x1f, 0x1e, 159 /* power */ 160 0x20 161 }; 162 int scancode; 163 164 scancode = keycode; | 1/*- 2 * Copyright (C) 2008 Nathan Whitehorn 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 148 unchanged lines hidden (view full) --- 157 /* open, paste, find, cut, audiomute, audiolower, audioraise */ 158 0x64, 0x65, 0x66, 0x67, 0x25, 0x1f, 0x1e, 159 /* power */ 160 0x20 161 }; 162 int scancode; 163 164 scancode = keycode; |
165 if ((keycode >= 89) && (keycode < 89 + sizeof(scan) / sizeof(scan[0]))) | 165 if ((keycode >= 89) && (keycode < 89 + nitems(scan))) |
166 scancode = scan[keycode - 89] | SCAN_PREFIX_E0; 167 /* pause/break */ 168 if ((keycode == 104) && !(shift & CTLS)) 169 scancode = 0x45 | SCAN_PREFIX_E1 | SCAN_PREFIX_CTL; 170 if (shift & SHIFTS) 171 scancode &= ~SCAN_PREFIX_SHIFT; 172 return (scancode | (up ? SCAN_RELEASE : SCAN_PRESS)); 173} --- 717 unchanged lines hidden --- | 166 scancode = scan[keycode - 89] | SCAN_PREFIX_E0; 167 /* pause/break */ 168 if ((keycode == 104) && !(shift & CTLS)) 169 scancode = 0x45 | SCAN_PREFIX_E1 | SCAN_PREFIX_CTL; 170 if (shift & SHIFTS) 171 scancode &= ~SCAN_PREFIX_SHIFT; 172 return (scancode | (up ? SCAN_RELEASE : SCAN_PRESS)); 173} --- 717 unchanged lines hidden --- |