From: Thomas Wilson on 13 Apr 2010 16:25 Hi All! I am looking for a way to have a script detect whether or not a key is pressed and held down before it runs. Basically, I want the script to execute one way if the key is pressed and another if it is not pressed. I plan on having the script launched automatically at startup and will need to have the key pressed before it runs. Can anybody point me in the right direction to achieve this? Thanks in advance! WPPK -- Posted via http://www.ruby-forum.com/.
From: andrew mcelroy on 13 Apr 2010 16:35 On Tue, Apr 13, 2010 at 3:25 PM, Thomas Wilson <t.wilson775(a)gmail.com> wrote: > Hi All! > > I am looking for a way to have a script detect whether or not a key is > pressed and held down before it runs. Is this within the context of a web browser, command line interface, or gui (like windows start up)? Your best bet is to automatically launch your first script which will watch for user input, then conditionally launch the next part. Without more info, I am not entirely sure what you are trying to accomplish. Andrew McElroy > > Basically, I want the script to execute one way if the key is pressed > and another if it is not pressed. > > I plan on having the script launched automatically at startup and will > need to have the key pressed before it runs. > > Can anybody point me in the right direction to achieve this? > > Thanks in advance! > > WPPK > -- > Posted via http://www.ruby-forum.com/. > >
|
Pages: 1 Prev: Gem help Next: Detect whether a key is being held before script executi |