none
Keyboard Driver code? RRS feed

  • Question

  • I now want to make a virtual keyboard driver (umdf), through the virtual keyboard (MFC designed keyboard buttons) send the key code value to the driver, after the driver received the key code value, the received key code value sent to the system, the system calls the application.

    For example, Calculator the key value Usagepage: 0x0c, UsageID: 0192. After the driver receives 0x0C and 0192, it is sent to the system, which compares the keycode values, and the calculator process is invoked upon successful matching.

    Is there any expert who can share your experience or drive demo? Thank you very much.


    • Edited by SkySmile123 Wednesday, March 4, 2020 9:58 AM
    Wednesday, March 4, 2020 9:43 AM

Answers

  • Look at VHIDMini2 in the WDK

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Wednesday, March 4, 2020 6:04 PM
    Moderator
  • If you don't know much about the WDK, then you are going to find working on a driver to be a challenge!

    You can find the driver sources here

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    • Marked as answer by SkySmile123 Friday, March 6, 2020 8:05 AM
    • Unmarked as answer by SkySmile123 Friday, March 20, 2020 3:02 AM
    • Marked as answer by SkySmile123 Friday, March 20, 2020 3:02 AM
    Thursday, March 5, 2020 2:20 AM
    Moderator

All replies

  • Look at VHIDMini2 in the WDK

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Wednesday, March 4, 2020 6:04 PM
    Moderator
  • Look at VHIDMini2 in the WDK

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Sorry, I am not very proficient in WDK. Could you tell me the url of VHIDMini2?

    thank you very much.

    Thursday, March 5, 2020 2:10 AM
  • If you don't know much about the WDK, then you are going to find working on a driver to be a challenge!

    You can find the driver sources here

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    • Marked as answer by SkySmile123 Friday, March 6, 2020 8:05 AM
    • Unmarked as answer by SkySmile123 Friday, March 20, 2020 3:02 AM
    • Marked as answer by SkySmile123 Friday, March 20, 2020 3:02 AM
    Thursday, March 5, 2020 2:20 AM
    Moderator
  • 如果您对WDK不太了解,那么您将发现在驱动程序上工作将是一个挑战!

    您可以在此处找到驱动程序源 

     -布莱恩


    Azius开发人员培训www.azius.com Windows设备驱动程序,内部,安全和取证培训和咨询。博客网址:www.azius.com/blog

        switch(controlInfo->ControlCode)
        {
        case HIDMINI_CONTROL_CODE_SET_ATTRIBUTES:
            //
            // Store the device attributes in device extension
            //
            hidAttributes->ProductID     = controlInfo->u.Attributes.ProductID;
            hidAttributes->VendorID      = controlInfo->u.Attributes.VendorID;
            hidAttributes->VersionNumber = controlInfo->u.Attributes.VersionNumber;
    
            //
            // set status and information
            //
            WdfRequestSetInformation(Request, reportSize);
            break;
    
        case HIDMINI_CONTROL_CODE_DUMMY1:
            status = STATUS_NOT_IMPLEMENTED;
            KdPrint(("SetFeature: HIDMINI_CONTROL_CODE_DUMMY1\n"));
            break;
    
        case HIDMINI_CONTROL_CODE_DUMMY2:
            status = STATUS_NOT_IMPLEMENTED;
            KdPrint(("SetFeature: HIDMINI_CONTROL_CODE_DUMMY2\n"));
            break;
    
        default:
            status = STATUS_NOT_IMPLEMENTED;
            KdPrint(("SetFeature: Unknown control Code 0x%x\n",
                                controlInfo->ControlCode));
            break;
        }
    
        return status;
    }

    I saw the demo you gave me, thank you very much.

    I also have this code, and now I'm making modifications with this Driver. Now I have a problem. Before WdfRequestSetInformation(), I received the UsagePage and UsageID sent by the virtual keyboard.I know RawData will be assigned to queue econtext-> devicecontext-> DeviceData, so are UsagePage and UageID also assigned to this variable?

    I don't quite understand this point. Could you help me sort out the logic?Thank you very much.

    I very look forward to your reply.



    • Edited by SkySmile123 Thursday, March 5, 2020 3:32 AM
    • Marked as answer by SkySmile123 Friday, March 20, 2020 3:01 AM
    • Unmarked as answer by SkySmile123 Friday, March 20, 2020 3:02 AM
    Thursday, March 5, 2020 3:30 AM