How to perform functions on keyboard press c#

Programerszz

I'm relatively new to C# and I want to know how can I press a key on my keyboard say the Q key and have it preform a list of functions? I want to form a list of function under neath it. Anybody have any idea how to do this? thanks

//Something like this
if keyboard_down(Q)
{
     //Do events here
}

I know this isn't the right function but that is basically what i want it to do. Winforms

Ofir

You didn't mention which technology you work with. I will assume that you are using Winforms.

In order to react to Key Press event you need to use Control.OnKeyPress - See here

See also this example which shows how to handle 'enter' key press

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to perform Stream functions on an Iterable?

how to iterate through functions with button press in Swift

How to link keyboard press to action

How to detect multiple(combination) keyboard press?

How to hide keyboard in swift on press of navigationBar

How to stop a stopwatch with a keyboard press in python?

Flutter: How to detect keyboard press Enter?

How to prevent duplicate chars when I press keys on the keyboard

How to press a jButton using keyboard key in Java?

How to open keyboard on button press in react native?

How to tell which keyboard was used to press a key?

How can I press a keyboard key using Objective C?

Simulating key press in C++ for use in QML for virtual keyboard

How can I display keyboard shortcuts as I press them?

How to add keyboard shortcut to press a specific key?

How does a keyboard press get processed in the Linux Kernel?

How the soft keyboard long press backspace works?

I'm unable to activate a C# button by the press of an Keyboard key

C# Simulating keyboard press on OS below Windows 8

Detox: iOS Simulator how to press Next on keyboard

How to set text to a label on keyboard key press in JavaFX application?

How to detect any key press with the keyboard module?

C# Key press (keyboard) to write a specific word by a string

Unity keyboard control (press on a key from C# script)

How can I translate a keyboard press to a value in my Java program?

C# WPF: How to programmatically press a keyboard button?

how combobox autocomplete when selected and then press enter keyboard then fill datagridview

How to detect long press on a UICollectionViewCell and and perform an action a the cell

How to simulate keyboard press in game(Lost Ark)