• AVR Freaks

Hot!USB keyboard scan code question of Win10 restart action

Author
Jen
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2016/01/28 23:01:43
  • Location: 0
  • Status: offline
2020/07/06 07:53:58 (permalink)
0

USB keyboard scan code question of Win10 restart action

Hi,
We develop a USB device using PIC16F1459.
The purpose of this USB device is that simulate a power button on motherboard.
Three functions of this power button :
a. Main power on/off
b. 4-second hold : software reset (Win10 restart action)
c. 10-second hold : put machine in standby mode
 
I can send "Sleep" keyboard scan code to put system into standby mode.
But, I cannot find "Restart" keyboard scan code to make a Win10 Restart action.
Does anyone know if any keyboard scan code to support "Restart" event ?
 
Rick
#1

3 Replies Related Threads

    RISC
    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: USB keyboard scan code question of Win10 restart action 2020/07/06 08:02:25 (permalink)
    +2 (2)
    Hi,
    There is a keypad reference design appnote for PIC16F1459 but I don't know if it implement sleep mode :
    https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en565508
    It is visible in the video on this page : https://www.microchip.com.wwproducts/en/PIC16F1459
    Regards

    For support make sure to check first here : http://microchipdeveloper.com
    There are hundreds of PIC, AVR, SAM...which one do YOU use ?
    #2
    davea
    Super Member
    • Total Posts : 278
    • Reward points : 0
    • Joined: 2016/01/28 13:12:13
    • Location: Tampa Bay FL USA
    • Status: offline
    Re: USB keyboard scan code question of Win10 restart action 2020/07/08 11:51:56 (permalink)
    +1 (1)
    win key = 147 ???
    #3
    KTrenholm
    Super Member
    • Total Posts : 787
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: USB keyboard scan code question of Win10 restart action 2020/07/08 13:53:43 (permalink)
    0
    AFAIK, there's no HID keyboard code for "Restart", but you may be able to do a key combination/macro in your firmware.
    There's some options for keystrokes to issue a Shutdown/Restart here:
    https://superuser.com/que...hree-keystrokes/968680
    Restart would be:
    Win+X
    U
    R
     
    It would essentially just be a macro to bring up the windows 10 quick menu, select "Shut Down or Sign Out", then "Restart"
     
    You may also want to look into having a USB Endpoint for system control.  This would essentially be a separate USB HID descriptor that would issue system control commands.  See:
    https://www.microchip.com/forums/m268630.aspx
     
    post edited by KTrenholm - 2020/07/08 13:59:33
    #4
    Jump to:
    © 2020 APG vNext Commercial Version 4.5