They both made it, but you didn't put a tag on it. I have tagged this one. > [hope this 2nd attempt makes it] >=20 >=20 > Hello, PIClist. >=20 > I am trying to make a USB-connected PIC18F2553 send some kind of event > every 30 seconds or so, to keep the screensaver on my Windows 7 PC from > activating while idle. >=20 > I figured the most innocuous events to send would be "volume up" > followed by "volume down" keypresses. I presume these key events will > reset the screensaver timeout, and don't see them affecting much else > that might be in the foreground. I want to leave the device plugged in > at all times, and mouse movements or virtually any other keypress might > be misinterpreted depending on what I'm working on. >=20 > I am using JALv2 and have the following code running. However the 0x80 > and 0x81 scancodes for Volume Up/Down do not seem to be recognized by > Windows. I have changed them to "alpha" keys and it accepts those and > produces the characters, so I know the underlying code is working. >=20 > The full USB HID scancode list is here: > http://www.freebsddiary.org/APC/usb_hid_usages.php >=20 > Anyone know how to get these events recognized, or have any other > "innocuous key" suggestions? >=20 > Thanks in advance for any insights! >=20 >=20 >=20 > Joe Koberg >=20 >=20 >=20 > ---------- JALv2 Code ----------------------- >=20 > include 18f2553 >=20 > pragma target PLLDIV P1 -- divide by 1 - 4MHz crystal > pragma target CPUDIV P2 -- Divide 96MHz PLL by 2 for C= PU > pragma target USBPLL F48MHZ -- Use PLL for USB > pragma target OSC XT_PLL -- Low-speed crystal with PLL= .. > pragma target clock 48_000_000 >=20 > include usb_keyboard >=20 > const USB_KEYBOARD_KEY_VOLUME_UP =3D 0x80 > const USB_KEYBOARD_KEY_VOLUME_DOWN =3D 0x81 >=20 > enable_digital_io() >=20 > usb_keyboard_init() >=20 > while( !usb_is_configured ) loop > end loop >=20 > var dword counter >=20 > forever loop > usb_keyboard_flush() > if( usb_is_configured() ) then > counter =3D counter + 1; > if( counter > 10000000 ) then > counter =3D 0 > ush_keyboard_send_key(0x00, USB_KEYBOARD_KEY_VOLUME_UP) > usb_keyboard_flush() > ush_keyboard_send_key(0x00, USB_KEYBOARD_KEY_NONE) > usb_keyboard_flush() > ush_keyboard_send_key(0x00, USB_KEYBOARD_KEY_VOLUME_DOWN= ) > usb_keyboard_flush() > ush_keyboard_send_key(0x00, USB_KEYBOARD_KEY_NONE) > usb_keyboard_flush() > end if > end if > end loop --=20 Scanned by iCritical. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .