Click here to Skip to main content
15,914,066 members
Everything / Keyboard

Keyboard

keyboard

Great Reads

by honey the codewitch
PianoBox is a customizable musical keyboard control for Windows Forms. This is the first part of MidiUI.
by Max Fedotov
Virtual Keyboard (TabTip) integration in WPF on Win 8.1 and Win 10
by Vedat Ozan Oner
A library for 5-button analog keypad
by Minh Danh Nguyen (ToughDev)
Dual-system Bluetooth keyboard setup: Seamless pairing with Windows 11 and Ubuntu 22

Latest Articles

by Minh Danh Nguyen (ToughDev)
Dual-system Bluetooth keyboard setup: Seamless pairing with Windows 11 and Ubuntu 22
by ToughDev
Custom USB device that processes input from peripherals and displays on computer
by AmrDeveloper
How to create a simple bot creator in Kotlin using only 33 lines of code
by Sergey Alexandrovich Kryukov
Microtonal Fabric Integration, the documentation project integrating Microtonal Fabric development with CodeProject

All Articles

Sort by Score

Keyboard 

9 Feb 2012 by Espen Harlinn
As CodeProject is mostly a Windows centric site I assume that you are looking for a solution that works on Windows - so have a look at: PyHook[^]Description from the project site:pyHook is a python wrapper for global input hooks in Windows. Specifically it wraps the Windows...
12 Jul 2020 by honey the codewitch
PianoBox is a customizable musical keyboard control for Windows Forms. This is the first part of MidiUI.
23 Aug 2016 by Max Fedotov
Virtual Keyboard (TabTip) integration in WPF on Win 8.1 and Win 10
26 Jan 2012 by Espen Harlinn
Have a look at: Processing Global Mouse and Keyboard Hooks in C#[^]it's an article on Application and Global Mouse and Keyboard Hooks .Net Libary in C#[^] from CodePlex.Best regardsEspen Harlinn
10 Jan 2014 by Vedat Ozan Oner
A library for 5-button analog keypad
22 May 2024 by Dave Kreskowiak
This has nothing to do with this site. You're going to have to ask the people for your "remote exam", whatever that means.
5 Feb 2012 by Sergey Alexandrovich Kryukov
This is absolutely impossible, for example, because there is no a way to disable Ctrl+Alt+Delete — the system won't let it no matter what you do.I'm not sure that global disable of anything else is possible, but you should not try to disrupt OS that much. The whole idea is...
9 Feb 2012 by Christian Graus
I found this :http://www.python-forum.org/pythonforum/viewtopic.php?f=1&t=10998[^]Python is a weird language to be doing keylogging in....
28 Mar 2012 by Sergey Alexandrovich Kryukov
How? The answer is: easily. Because these days most systems support Unicode.Further detail depend on such boring things as platform, language, used libraries, etc. It does not look like you care too much about that. :-)[EDIT: in response to a follow-up question]With C++, you need to...
18 Sep 2012 by Member 8266594
Hi,I have an application and when I press "Windows button + arrow up" it jumps to the top left corner and resizes to maximum. This is standart feature of this keyboard shortcut but the problem is that after this I can only resize it, not move it. Where can be the problem? or maybe even better...
9 Oct 2012 by YvesDaoust
This is not really a programming question, is it (?)I dream of being able to permanently assign keyboard keys some predefined character string so that I can enter frequently used text (e-mail address f.i.) very quickly.This can be a function key or a special key combination or a sequence...
9 Oct 2012 by Legor
Refer to this article: http://cybernetnews.com/hotkeys-for-windows/[^]There its is explained how to use Clavier+[^] to assign custom keyboards. It is also said that you can "set up a shortcut to launch a program/website, or output some text to the field currently selected on the screen."
27 Aug 2013 by MuthukaruppanP
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam){ if (nCode == HC_ACTION) { KBDLLHOOKSTRUCT* p = (KBDLLHOOKSTRUCT*) lParam; if (p->vkCode == VK_LMENU) { if (wParam == WM_KEYDOWN) ...
19 Oct 2013 by Ron Beyer
Here is a good example:http://pinvoke.net/default.aspx/user32/keybd_event.html[^]PInvoke.net[^] is a great resource when doing windows API calls.
19 Oct 2013 by Sergey Alexandrovich Kryukov
Using the function keybd_event is not recommended, as it has been superseded with SendInput. Please see:http://msdn.microsoft.com/en-us/library/windows/desktop/ms646304%28v=vs.85%29.aspx[^],http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx[^].This is the...
22 Aug 2014 by bling
Seems like you're going to have a fight with windows over control of the keyboard input focus.When you run your program - from a command line or through windows explorer, the keyboard focus moves to whatever window you used to run the program.One the program starts, as a console program...
14 Aug 2015 by Sergey Alexandrovich Kryukov
Please see my comment to the question.See also my past answers on virtual keyboards: How to fire a Key Press event of a Key on button click in WPF [1],How to fire a Key Press event of a Key on button click in WPF [3],Application focus getting and losing.Don't pay attention that...
12 Dec 2016 by Ramza360
This seems related: Double Key Code.If what you are trying to achieve is using the Shift Key and the C key to do the button15.PerformClick() then you have to check the Modifiers in the KeyEventArgs instance.Try this:private void Main_Form_KeyDown(object sender, KeyEventArgs e) ...
6 Oct 2020 by Gerry Schmitz
"Swallow" the Key you don't want (e.Handled = true), then "send" the Key you want in its place. WPF – Send keys | michlG's Blog[^]
23 Jan 2024 by Minh Danh Nguyen (ToughDev)
Dual-system Bluetooth keyboard setup: Seamless pairing with Windows 11 and Ubuntu 22
22 May 2024 by OriginalGriff
Even if we did - which would mean knowing the application pretty thoroughly and we have no idea which app this actually is - why do you think it would be a good idea to tell you? The only reason for doing this would be to try and cheat the exam...
26 Jan 2012 by NeptuneHACK!
Hello fellow coders,I have a "Logitech" Keyboard, but unfortunately no software bundle came with it, to help me use the Function keys "F1, F2, F3...etc" & as you know these keys are very useful if I could only write a program that runs in the background, that allows me to specify a function to...
28 Jan 2012 by Santoshshrest
there is the event for every properties and forms...i.e keydown event...you can useprivate void frm_KeyDown(object sender, KeyEventHandeler e){ if(e.KeyCode==) { //work.... }}
5 Feb 2012 by Ed Nutting
Hi Safi,Assuming that you are trying to do this for your application only, why not just have a bool in your code that is something like AcceptInput. Then, detect the F11 key and set AcceptInput to false. If you detect the F10 key, set it to true. Finally, wrap all your other keyboard/mouse...
6 Feb 2012 by NeptuneHACK!
None of these are the solution I seek, I wish to lock my keyboard keys globally, I have a GlobalHook that listens to my keystrokes, and I want to make a (IF) block that activates when a certain keyUp event happens, and deactivate when another keyUp event accords, it's really important, and I...
9 Feb 2012 by danger man 2011
how can i recording of everything that is entered from the keyboard using `python`
27 Mar 2012 by subhendu_m
can anyone tell why is this code not working???#include "stdafx.h"#include #include #include using namespace std;// Keyboard layout structureclass _KeyboardLayout{public: HKL hBengali; bool bBengali; HKL hEnglish; bool...
27 Mar 2012 by wizardzz
can anyone tell why is this code not working???Yes, your error messages can.
27 Mar 2012 by subhendu_m
there are error messages. but it should work. i'm newbie in visual programming. but it is not working in the way it should work. it is not activating the required keyboard layout.
27 Mar 2012 by Amir Mahfoozi
It seems that you load the Bengali language then neutralize that with activating previous language(which is most probably English). So removing the ActivateKeyBoardLayout may help you.With assumption that Bengali is already has been installed then just a simple call to LoadKeyboardLayout...
29 Mar 2012 by subhendu_m
it was a command line project.that's why it didn't show the results.
9 Oct 2012 by Briti Sundar
You can try this way ... First: Trap key presshere is an example how to do that ??http://support.microsoft.com/kb/320584[^]Second: Call your method according to key pressThird: inside method start your process.Process.Start("your_process");Enjoy your work :D
2 Nov 2012 by Jacques Loubser
HiYou can try using DirectX. Run a Service or invisible program(one that never reaches the end of the Load Event) that uses DirectX to take sole control over the keyboard & mouse. I don't know if Windows will allow this, but it is supposed to work, especially with joysticks etc.Jacques
12 Nov 2012 by Jacques Loubser
Okay Here it IsFirst, you must download ht Windows SDK (it has the Direct X SDK included) You will also want to download a redirstrabutable Direct X as you will your application will require it.Second here are the Import statements:Imports Microsoft.DirectXImports...
17 Dec 2012 by AHSAN111
Please read the link How can I block keyboard and mouse input in C#?[^].This will help.
17 Dec 2012 by sisir patro
Hi,Refer this link...disable mouse click event system wide using C#?this may help you.Thanks
20 Jan 2013 by Sandeep Mewara
It does not work like this here.Here is what is expected of enquirers:1. TRY first what you want to do! You may find that it's not that hard.2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues.Members will be more than happy...
29 Jan 2013 by Trapper-Hell
Dear all,Thank you for taking the time to read my question.I hate asking questions without any context or explanation, but I do not wish to scare users and prospect answers away, so please find the TL;DR question below and more detail underneath.I need to inject the exact keys...
29 Jan 2013 by Sergey Alexandrovich Kryukov
If you need to send raw keyboard input, you need to do it before it was interpreted as character. That is, the only thing you can use is the Windows API function SendInput:http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^].With .NET, you can use it...
6 Feb 2013 by Jeff Blankenburg
You can't prevent the keyboard from covering your app. Can you explain this further? There are ways to scroll your content, for example, so that your custom window is still visible.
18 Feb 2013 by Transitional
I have a usb cardreader that is recognized by my PC like a keyboard. I wrote a small app to read the data from the card, but it doesn't work I dont get any data in my filestrteam. I was wondering if the hid class works for keyboard like devices.
18 Feb 2013 by CPallini
Quote:I was wondering if the hid class works for keyboard like devices.Yes, see, for instance HID at Wikipedia[^].
6 Mar 2013 by Irina Pykhova
use underscore in text: '_Apple', '_Ball', 'E_xample'
8 Mar 2013 by kumar.selva.c
I have listview with Checkbox Items that are not HardCoded in XAML i load them during run time,I have two scenarios ***- Listview items Hardcoded - ListView items loaded Through Itemsource***ListviewItems with Checkbox HardCoded *> Apple , Apple1 , Ball, Bottom, Mango,...
6 Apr 2013 by Alessio Elia
Hi all,Do you know, how i can resize and eventually move the the default Android keyboard in my app?I've developed an app for android 4.0 (Samsung Galaxy Tab 2.0) and the user for variuos reasons have the tablets inside a wood box. A little part of this box covers the bottom of tablet...
22 Jun 2013 by Member 9522119
private void timer1_Tick(object sender, EventArgs e){ if (Form.ModifierKeys == System.Windows.Forms.Keys.Control && Form.ModifierKeys == System.Windows.Forms.Keys.Enter) my_translate(textbox1.text); }I try it but dont work how can I do it?I am writing a dictionary...
22 Jun 2013 by Ron Beyer
OK, I'm not agreeing with how you are going about this, but what you are trying is not working because you are trying to detect key presses in a different application than yours. If you want to determine what keys are down, you can use this class: static class NativeMethods { ...
26 Jun 2013 by mekalareddy
Dear,i thick its not possible it is by default try to built your own keyboard
5 Jul 2013 by kumar.selva.c
I have an usercontrol with a `LlistBox`, which has an `ItemsSource` with a Collectionview. In order to group, I used the group style where the grouped items will be within the `Expander` control as follows.I want the `Exapander` with the label content "UNKNOWN" has to be Closed by default...
5 Aug 2013 by wladimirbm
Hello, i have scanner 2d honeywell xenon 1900, it work like hid-keyboard.in my program i use hooker for keyboard, which intercept press keys on keybordand when i press on keyboard in english layout - hooker understand virtual_code and scan_code of keysbut when qr code consist english...
3 Oct 2013 by Belloanton
First: Sorry about my bad English!Now my Question.I am Trying to write a program for a Keyboard.Example: If i Press the C on a Music Keyboard, and the Program Shows a C (via Microphone Input)I know it possible to program a Guitar Tuner...I hope you understand what i...
3 Oct 2013 by OriginalGriff
The easiest way is to hold the notes as individual WAV or MP3 files - for a Guitar tuner where you need a small number of notes that is fine - and play them on the keystroke.If you save them as WAV files, you can add them to your application Resources, and play them very easily:SoundPlayer...
3 Oct 2013 by BillWoodruff
Are you saying that you want to press a note-key on a MIDI keyboard, like middle-C, and have a middle-C note shown in some form, in your .NET application ?If you are using a MIDI keyboard, see: [^].Please clarify exactly what you refer to when you use the term: "keyboard."
15 Oct 2013 by JL_Coder
Hello. I have one third party tool, which is an authoring tool/software to create e-learning contents. In which I want to add one onscreen keyboard when a students clicks on a textbox to write. How can do? I heard about tinymce software. Can it be done using it?
18 Oct 2013 by Manoj K Bhoir
Unfortunately you cannot do this.You cannot remove user finger from keyboard using your code. :)But you can cancel the key press event using handle on KeyPress Event.Write below code on your KeyPress Event :e.Handled = True
18 Oct 2013 by Sergey Alexandrovich Kryukov
To release the key, you need to mount a special motion system based on a servo or stepping motors and controller, so it would push your buttons up on request of your code.If you want something else, this question makes no sense at all.—SA
19 Oct 2013 by Hadi Ayash
Hey,Does anyone know how can I use the Keybd_event function:Declare Function keybd_event Lib "user32" Alias "keybd_event" ( _ByVal bVk As Byte, ByVal bScan As Byte, _ByVal dwFlags As Long, ByVal dwExtraInfo As Long) As LongWhen I use it I get the error:A call to PInvoke...
18 Nov 2013 by Luiey Ichigo
Hi all,I'm just start implementing winform which integrate with usb keyboard. I try to search on the internet but I don't found any success keyboard input.If you guys have suggestion, I need guide for complete build app integrate with USB keyboard which start from import,declaring and...
18 Nov 2013 by OriginalGriff
Assuming that the keyboard is a standard device, then it needs no work on your part at all, unless you want to capture some keystroke combinations and use them as "hotkeys" in your application.A keyboard is handled by the OS and just passes data through via the normal events, regardless of...
18 Nov 2013 by Zoltán Zörgő
So you want simple shortcuts.First of all, if you use buttons shortcut availability is default. Simply put an amp in the text: Button1.Text = "&Ok"; , and you have Alt+O as shortcut (but you don't want this for some reason). With menus, you have even more possibilities, see here:...
26 Jan 2014 by Member 9066404
Hello sir/madamI am designing my own Email System like Gmail. In this I want to use word prediction technique in Compose mail TextBox.I mean when Someone type something in compose mail textbox ,it should automatically retrieve values from database.That's fine,, With PHYSICAL...
25 Feb 2014 by Sergey Alexandrovich Kryukov
You can created it by doing some programming work. As your concern is not clear, I cannot tell you anything specifically useful; and you cannot expect that someone writes a complete solution for you. Anyway, please see this article: A software Virtual Keyboard for your WPF apps[^].—SA
27 Mar 2014 by Steve Thresher
Does anyone know how to change the keyboard layout for windows services and applications started by windows services. I have a server where every language / region / location option I can find is set to English UK / British but the keyboard layout name returned by services running on the server...
27 Mar 2014 by Steve Thresher
We have an automation layer built into our applications which records windows messages to be replayed later. This allows a user to 'record' the generation of a report and then 'play' that back when required. Part of the application in question is the recording of a recipient email address. When...
17 Apr 2014 by Abhisar Garg
i was using this code....________________________________________________________________[DllImport("user32", EntryPoint = "SetWindowsHookExA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] public static extern int SetWindowsHookEx(int idHook,...
26 Apr 2014 by GeorgeGkas
Hello guys,Recently I installed android v4.4 in my laptop, which I dual boot with windows 8. I want to ask you something that have pissed me off and I want to know if there is any solution.Well, as you thought I use my laptop keyboard to write. I have default input language "English",...
19 Nov 2014 by VigneshKumar957
Hi All,I need some clarification regarding implementing keyboard shortcuts in my web application using ASP.NET. I am planning to store keyboard shortcuts for each user against my application, so that user can store their own keyboard shortcuts in database. When user login to the website the...
28 Apr 2015 by dborzouei
no answer ? faced anybody with this problem
30 May 2015 by Behnam Mohammadi
hii wanna crate custom keyboard in android.i wanna use this code http://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615[^]but now i wanna make Arabic keyboard but i have problem with that because Arabic ASCII code is two part and the XML doesn't support...
14 Jun 2015 by Umut Comlekcioglu
Hi everyone,I need to lock keyboard for my project. How can I do this? It's need to work all Windows systems(Win 7 and Win8 for start)..I'm waiting for answer. Thanks for answers. Have a good day..
14 Jun 2015 by Umut Comlekcioglu
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam){if (nCode == HC_ACTION){KBDLLHOOKSTRUCT* p = (KBDLLHOOKSTRUCT*) lParam;if (p->vkCode == VK_LMENU) // VK_LMENU = ALT key{switch (wParam){case WM_SYSKEYDOWN :{ // use SYSKEYDOWNcout
12 Oct 2021 by Ali Majed HA
HelloI am coding a Windows Form Application and I need to active an on-screen keyboard by pressing a key. I have tried applications like Hot Virtual Keyboard but the problem is when I activate keyboard, some part of my application form wull be hidden under the keyboard application. I need to...
18 Sep 2016 by CaptainEddy
I'm working on keyboard app and I want to change layout after user press particular key on keyboard. Check below imagesFor Example : Here - After we touch that button layout changes into thisCan anyone explain me how it's done?This is my java class which extends...
19 Sep 2016 by Alex Banu
Take a look at: How to Use Windows On Screen Keyboard in C# WinForms - Stack Overflow[^]
12 Dec 2016 by Member 9983063
Hello Guys, i want to know i know how to perform click on key down event but i dont know how to use double short keys for this i mean to say when i am pressing c so button 15 perform click but i want to do this with shift + cThanksWhat I have tried:private void...
15 Dec 2016 by Member 12904911
Hi all. I am trying to write simple c# program,but all tutorials and snippets on the net doesn't work for me(I have only very basic knowledge of C#). I come to you guys for help if possible please. What I am trying to do is send some keystroke to application in the background (The rest of...
15 Dec 2016 by johannesnestler
So what? the Code you showed has 3 Windows-API Calls that are exactly the same called by C# (for C# is's a call over Platform-Invoke (PInvoke) - the same you do in Python. Than you have one .NET call to System.Threading.Thread.Sleep(Milliseconds).In the time you wrote all the ... comments here...
1 Feb 2017 by Member 12779048
Hi I have a question about interctivity while using WMI in c#, I am running command on my remote desktop using wmi for example:cmd /c C:\test.exeNow while doing that process asks to press any key to continue.I had an idea that command would dump result to some sort of log file so...
1 Feb 2017 by Dave Kreskowiak
You cannot do that for very obvious security reasons.A process launched on a remote machine is launched in a manner that does not allow a user interface to show to the user logged into the remote machine. There is no way to give any input to that process. If it's waiting for input, it will...
1 Feb 2017 by Member 12779048
Aye I see, well then I have no choice but to do it with power shell execution script.
1 Dec 2018 by Thaana Paana
The following code holds keys and releases it [DllImport("user32.dll", SetLastError = true)] static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); public const int KEYEVENTF_KEYUP = 0x02; public const int VK_W = 0x57; private void...
11 May 2019 by Zhivko Kabaivanov
Knowledge of the topic: C / C++, Windows API, C#, and something along these. I have an application written on C#. We will call it A. Application A uses the Windows API to simulate keyboard key press (TAB, some text, SHIFT) using SendInput (link). I can note that when using this simulation...
12 May 2019 by RickZeeland
Maybe these articles will be of help: https://dzone.com/articles/sending-keys-other-apps[^] and: Sending Keystrokes to another Application in C#[^] Another option might be using an automation tool like AutoHotkey, see overview here:...
3 Jun 2019 by Quantum Divergence
I do not want to open up a URL. Instead, I want to open up a blank screen/new blank page. How do I achieve this? Thank you in advance! What I have tried: The code I have so far is this: document.addEventListener('keydown',function(e){ if(e.keyCode==65)//key code for 'a' ...
3 Jun 2019 by Nirav Prabtani
Try this Click the button to open a new browser window. Try it function myFunction() { window.open("https://www.xyz.com"); } Reference : Open new tab : W3School[^]
18 Jul 2019 by lock&_lock
I need to perform pixel manipulation from images in glut OpenGL (I know it's old, but I'm bound by many other reasons). I need to change the image several times while showing them at the same time as well. I'm trying to use key event to perform that. Also, I'm using SOIL library to load my...
18 Jul 2019 by Rick York
The only thing your event handler does is load an image. What handles display of the image? Usually, when you load an image you have to invalidate the display window so that it is redrawn. I see no code that does that so that is probably what you lack to make it work.
19 Feb 2020 by Member 14749425
Hi everyone, I am working on a project in PYTHON and I want to create a keylogger for 2 languages english and greek. For this I have created the below code. from pynput.keyboard import Key, Listener from langdetect import detect from pynput...
6 Oct 2020 by mojtabahakimian
Hello I'm using wpf c# in visual studio i want to prevent user can enter Arabic character , Just Persian Character like when user entered this value on keyboard → "ي" change it to "ی" my means something like this : when user press button to...
4 Jul 2021 by Just Coookie
I am trying to make it so the key I press assigns itself to a variable. Like so I would click s and the variable would equal "s". How would I do this? What I have tried: if keys[pygame.K_q]: letter1 = "Q" I don't want to do...
4 Jul 2021 by Dave Kreskowiak
You wouldn't use 26 different variables to hold these values you click. You would normally use an array to hold the values. I'd be more specific, but your question isn't very clear about what you're doing.
4 Jul 2021 by Richard MacCutchan
You should study the Pygame documentation to see how it handles keyboard input: Pygame Front Page — pygame v2.0.1.dev1 documentation[^].
16 Mar 2023 by 11_
I'm having an issue whereby I've setup a keyboard hook in my application that works perfectly from both within my app and when any other app is in the foreground. I have a need to connect to an external MS Access database, but on doing so I...
18 Apr 2021 by AmrDeveloper
How to create a simple bot creator in Kotlin using only 33 lines of code
27 Jan 2014 by Vít Blecha
How to combine the Raw Input and keyboard Hook APIs, and use them to selectively block input from only some keyboards.
26 Apr 2014 by Mehdi Gholam
On my Asus TF700 when you have the default Asus keyboard selected you can switch languages with Ctrl+Shft which brings up a dialog to select your language.
20 Mar 2015 by Amit Singh Baghel
A tip to fulfill the requirement of getting the Hindi Inscript Typing on your website without using any external software
18 Sep 2012 by fjdiewornncalwe
In Windows 7 this is standard behavior. The Windows->Arrow Up command maximizes the window. Maximized windows cannot be moved unless they are resized first. There is no problem here.
14 Apr 2013 by Frank R. Haugen
My Google-Fu only gave me results like Synergy[^], which all on is own is a neat app, but not what I'm looking for. Nor is any of the "remote desktop" applications I've looked at.What I'm looking for:I'm either looking for an application, or some information to get me on the right track to...