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 7067319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:11:16+00:00 2026-05-28T05:11:16+00:00

I’m using Mono C# and would like to know what physical library input.h is

  • 0

I’m using Mono C# and would like to know what physical library “input.h” is dependent on?
Ive searched google but am not getting anything.

NOTE UPDATE: The goal here is to get Keyboard and Mouse input in Linux. So rly the question is what library do I need to wrap for input. Are there any good C/C++ examples for getting input using “input.h”?

In C# to link to a library you would do something like::

[DllImport("libX11", EntryPoint = "XOpenDisplay")]
public static extern IntPtr XOpenDisplay(IntPtr display_name);

So I need to do the same thing as above but with the input library. Something like::

[DllImport("libInput ???", EntryPoint = "CreateDevice")]
public static extern IntPtr CreateDevice(int deviceID, ...);

I was going to use this Keyboard Input link to get started after I find what library to link to…

  • 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-28T05:11:17+00:00Added an answer on May 28, 2026 at 5:11 am

    Ok so I figured out how to get all the key and mouse input through X11. I’m doing something very similar in Cocoa on OSX.

    So for anyone wondering the basics of how I did it, Here ya go and let me know if you see anything wrong with the X11 event logic::

    // Enable Capture of close box
    var atom = XInternAtom(d, "WM_DELETE_WINDOW", false);
    XSetWMProtocols(d, w, new IntPtr[]{atom}, 1);       
    
    bool run = true;
    while (run)
    {
        while (X11.XPending(d) != 0)
        {
            X11.XPeekEvent(d, ref e);
    
            switch (e.type)
            {
                case (X11.Expose):
                    Console.WriteLine("Window Scaled.");
                    break;
    
                case (X11.ClientMessage):
                    Console.WriteLine("Window Closed.");
                    run = false;
                    break;
    
                case (X11.KeyPress):
                    Console.WriteLine("Key pressed: " + e.KeyEvent.keycode.ToString());
                    //run = false;
                    break;
    
                case (X11.KeyRelease):
                    Console.WriteLine("Key released: " + e.KeyEvent.keycode.ToString());
                    //run = false;
                    break;
    
                case (X11.ButtonPress):
                    Console.WriteLine("MouseButton pressed: " + e.KeyEvent.keycode.ToString());
                    //run = false;
                    break;
    
                case (X11.ButtonRelease):
                    Console.WriteLine("MouseButton released: " + e.KeyEvent.keycode.ToString());
                    //run = false;
                    break;
            }
    
            X11.XNextEvent(d, ref e);
    
            //Console.WriteLine(e.type.ToString());
        }
    
        Console.WriteLine("Render GL frame here...");
    
        // Cursor loc
        /*IntPtr w2, w3;
        int x, y, x2, y2;
        uint mask;
        XQueryPointer(d, w, out w2, out w3, out x, out y, out x2, out y2, out mask);
        Console.WriteLine(string.Format("{0}, {1}", x, y));
        Console.WriteLine(string.Format("{0}, {1}", x2, y2));*/
    
        System.Threading.Thread.Sleep(500);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I need to clean up various Word 'smart' characters in user input, including but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace

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.