Keyboard Input (Win32Lib Question)
- Posted by Brent Hugh <bhugh at CSTP.UMKC.EDU> Dec 12, 1999
- 446 views
Hi all, I'm getting keyboard input using Win32lib (I'm still using version 0.20d if it makes a difference). What I am interested in for the purpose of the program I am working on, is the *position* of the keys, as opposed to their actual letter or number value. What I am doing is making a virtual "piano keyboard", so, for instance, I am making the computer keyboard's "qwertyui" = "abcdefgabc" on the piano keyboard. I started out by using onKeyPress. It worked OK, but I realized that I will run into a problem if anyone running my program is using certain international keyboard layouts that remap the keyboard. For instance, in the German keyboard layout, the "z" key is where the "y" key is in the English (United States) layout. Then "qwertyui" becomes "qwertzui" and I'm in trouble. Other international layouts make various changes in the keyboard layout along these lines, from what I understand. What I want, is to be able to map the "qwerty" row of the keyboard to "cdefgabc" regardless of whether any international keyboard layout is selected. I thought maybe "onKeyDown" will do this for me. Supposedly it returns "key codes", although I'm not sure exactly what is meant by the term "key codes". Will "onKeyDown" do the trick, or does anyone know a (relatively) simple way to solve this problem? Thanks in advance! --Brent +++++++++++++++++++ Brent Hugh / bhugh at griffon.mwsc.edu ++++++++++++++++++ + Missouri Western State College Dept of Music, St. Joseph, Missouri + + Piano Home Page: http://www.mwsc.edu/~bhugh + + Internet Piano Concert: http://cctr.umkc.edu/userx/bhugh/recital.html + ++++++++++ Classical Piano MP3s http://www.mp3.com/brent_d_hugh ++++++++++