Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6966567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:12:31+00:00 2026-05-27T16:12:31+00:00

I am attempting to simply detect whether there is a keyboard attached to the

  • 0

I am attempting to simply detect whether there is a keyboard attached to the PS/2 port on my machine. The idea is that the computer will boot up, although if it detects a USB device or PS/2 keyboard, it reboots into an administrator mode.

I have handled the USB aspect, although I have had no luck in finding any documentation for the PS/2 port. Some posts have said it is not possible to detect a keyboard plugged into a PS/2 port after boot, although I simply wish to check whether there is one connected at boot time.

I am using C# for my program and therefore any solution in this language would be very helpful, although assistance in any language would be beneficial.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:12:32+00:00Added an answer on May 27, 2026 at 4:12 pm

    WMI seems to be doing it:

    ConnectionOptions opts = new ConnectionOptions();
    ManagementScope scope = new ManagementScope(@"\\.\root\cimv2", opts);
    string query = "select * from Win32_Keyboard";
    System.Management.ObjectQuery oQuery = new ObjectQuery(query);
    ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, oQuery);
    ManagementObjectCollection recordSet = searcher.Get();
    foreach (ManagementObject record in recordSet)
    {
        Console.WriteLine("" + record.Properties["Description"].Value);
        Console.WriteLine("" + record.Properties["Layout"].Value);
        Console.WriteLine("" + record.Properties["DeviceID"].Value);
        Console.WriteLine("" + record.Properties["PNPDeviceID"].Value);
        Console.WriteLine("" + record.Properties["Status"].Value + "\n");
    }
    

    returns:

    USB Human Interface Device
    0000040C
    USB\VID_03F0&PID_0024\6&1A939CC4&0&1
    USB\VID_03F0&PID_0024\6&1A939CC4&0&1
    OK
    
    Standard 101/102-Key or Microsoft Natural PS/2 Keyboard
    0000040C
    ACPI\PNP0303\4&3432CBB0&0
    ACPI\PNP0303\4&3432CBB0&0
    Error
    

    I don’t have a PS/2 keyboard, so the status gives an error, but you should have an OK status if one is connected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to make a simple linear text game that will display inside a
I'm attempting to define an extremely simple utility method that will save me from
I am attempting to setup a mod_rewrite that will do the following www.mysite.com/dir/ignoreMe will
I am attempting to setup a mod_rewrite that will do the following www.mysite.com/dir/ignoreMe will
I'm attempting to do an AJAX call (via JQuery) that will initiate a fairly
I have the following code that I'm attempting to simply loop through an entity
I am simply attempting to get jquery to identify the first letter of a
i'm attempting to simply set the caret position at the start of the text
I simply can't work this out, I'm attempting to sum the value of TOTAL
I'm simply attempting to use a soap header for authentication purposes. After adding a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.