Time for action – creating the keys of the piano
Follow the given steps:
- Create a Windows form. Place the controls as shown in this video: http://sudipta.posterous.com/private/eweuvoFJwb. Eventually, your layout should look like the one shown in the preceding screenshot. As it is a complex layout, I have created the video to help you.
- Add the following variables to
Form1.cs
:bool startRecording = false;
This will be set to
true
when the app starts recording keystrokes. - Add the following field to the
Form1.cs
:string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Dictionary<string, string> pianoNotes = new Dictionary<string, string>(); Dictionary<string, char> keySettings = new Dictionary<string, char>(); List<KeyValuePair<string, DateTime>> keyPressRecord ...
Get .NET 4.0 Generics now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.