Hello there guys, I am working on a new idea I had...
This is what I am looking do to, but I have no idea how.
This is pretty much what I want,
User can configure 20 Keys, of his/her choise to do things..
Example, I have 10 functions on the program, Play sound1, play sound 2, play sound 3, play sound 4, play sound 5, etc... (i will be using windows media inside visual studio)
Ok, so in another words, I added 20 windows media players(invisible) to my form...
It's very easy to make something play programatically, but, I want to have configurable keys. For example...
User can choose which keyboard key will play which sound,
Example:
C = players sound1
Y = Plays sound2
How do I make this happen ?
I thought about keydown event, but I'm really not sure what im doing... specially knowing I want the user to be able to select the desired key.
Thanks guys.
Loading
thiago costaPosted Apr 29, 2012, 9:04 PM
public Form1()
{
InitializeComponent();
//KeyDown += new KeyEventHandler(Form1_KeyDown);
this.KeyPreview = true;
}
int i = 27;
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == i)
{
MessageBox.Show("");
}
}
// Since I am here talking about the subject, if this ever helps anyone , here is the keyvalue list..
Key
Key code
ASCII key code
In the example above, I used key 27, which is ESC....
I made int i = 27.
now I can just have a .txt file and I can use the read file and import desired settings from text files or something:D
lol I hope the rest goes smoth
Thanks guys