Re: Keycode problem
- Posted by "Juergen Luethje" <j.lue at gmx.de> Jan 10, 2004
- 494 views
Allen wrote: > Sorry, I didn't make it clear. With key.bat, I get the code 401 for ctrl > downkey. In the program that I am creating, x=wait_key() yields 336 for > downkey, for ctrl downkey and for alt downkey. In other words, key.bat > performs as expected, my program, running on Windows 98 does not. "key.bat" runs the program "key.ex". That program uses the built-in function get_key() to get the keycodes, while you use wait_key() for this purpose. But this should not cause the problem, since as far as I know get_key() and wait_key() return the same keycodes. Let me guess: Your program is a Windows application (say "myprog.exw"), right? "key.ex" is a DOS program. If you rename your program to say "myprog.ex", then it is a DOS program and will probably work as expected (a least regarding the point in discussion here). I just realized, that wait_key() (as well as get_key()) in some cases returns different key codes, depending whether the program runs on DOS or Windows (what about Linux?). So this might be the explanation, but not the solution. I think a Windeows application must use a differnt way to get the desired information. I'm sure someone else here knows how to do so. [snipped old text] Regards, Juergen -- /"\ ASCII ribbon campain | |\ _,,,---,,_ \ / against HTML in | /,`.-'`' -. ;-;;,_ X e-mail and news, | |,4- ) )-,_..;\ ( `'-' / \ and unneeded MIME | '---''(_/--' `-'\_)