Loading ...
Sorry, an error occurred while loading the content.

543RE: [perlguitest] Re: Quake Console Update Unreliable

Expand Messages
  • Chris Hilton
    Jul 21, 2004
    • 0 Attachment
      Yeah, that's what I meant by "getVirtualKey() and looking up the constant
      values left as exercises for the reader". You'll need to write
      getVirtualKey() to convert letters to virtual keys. You'll also need the
      constant values for WM_KEYDOWN, WM_KEYUP, and the virtual key codes (from
      winuser.h, I think) and, I would recommend, set them up as constants in your
      Perl program.

      use constant WM_KEYDOWN => <whatever>;
      use constant WM_KEYUP => <whatever>;

      Chris Hilton

      -----Original Message-----
      From: coolrobd [mailto:coolrobd@...]
      Sent: Tuesday, 20 July, 2004 16:11
      To: perlguitest@yahoogroups.com
      Subject: [perlguitest] Re: Quake Console Update Unreliable


      Naerly there I think - Just can't get then SendMessage to work. Do
      I need to setup the WM_KEYDOWN?

      Also getVirtialKey does not work - just wondering if you where
      expecting me to knock up the code behind it?

      Cheers for the help.

      --- In perlguitest@yahoogroups.com, Chris Hilton <chilton@n...>
      wrote:
      > I thought about suggesting this before, but it's a good bit more
      > complicated. Trying to keep it as simple as possible, I believe it
      would be
      > something like this:
      >
      > foreach $letter (split(//, $text)) {
      > $vk = getVirtualKey($letter);
      > SendMessage($window, WM_KEYDOWN, $vk, 1);
      > SendMessage($window, WM_KEYUP, $vk, 1);
      > }
      >
      > With getVirtualKey() and looking up the constant values left as
      exercises
      > for the reader. Note that if you want to send a two-key
      combination, like a
      > capital letter for the following example, you'll need to send a
      key down
      > message for the virtual shift key, send your letter, then key up
      the virtual
      > shift key. Here's some URLs that might come in handy.
      >
      > SendMessage:
      > http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinUI
      > /WindowsUserInterface/Windowing/MessagesandMessageQueues/Messagesan
      dMessageQ
      > ueuesReference/MessagesandMessageQueuesFunctions/PostMessage.asp
      > < http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinU
      >
      I/WindowsUserInterface/Windowing/MessagesandMessageQueues/Messagesand
      Message
      > QueuesReference/MessagesandMessageQueuesFunctions/PostMessage.asp>
      > WM_KEYDOWN:
      > http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinUI
      > /WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReferenc
      e/Keyboar
      > dInputMessages/WM_KEYDOWN.asp
      > < http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinU
      >
      I/WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReference
      /Keyboa
      > rdInputMessages/WM_KEYDOWN.asp>
      > WM_KEYUP:
      > http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinUI
      > /WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReferenc
      e/Keyboar
      > dInputMessages/WM_KEYUP.asp
      > < http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinU
      >
      I/WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReference
      /Keyboa
      > rdInputMessages/WM_KEYUP.asp>
      > Virtual Key Codes:
      > http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinUI
      > /WindowsUserInterface/UserInput/VirtualKeyCodes.asp
      > < http://msdn.microsoft.com/library/default.asp?url=/library/en-
      <http://msdn.microsoft.com/library/default.asp?url=/library/en->
      us/winui/WinU
      > I/WindowsUserInterface/UserInput/VirtualKeyCodes.asp>
      >
      > I think it's a bit of overkill unless you've tried the other way
      and found
      > it lacking, but good luck.
      >
      > Chris Hilton
      >
      > -----Original Message-----
      > From: coolrobd [mailto:coolrobd@y...]
      > Sent: Tuesday, 20 July, 2004 07:22
      > To: perlguitest@yahoogroups.com
      > Subject: [perlguitest] Re: Quake Console Update Unreliable
      >
      >
      > SendMessage is definately the way to go I feel, but how do you
      pass a
      > letter using SendMessage, any syntax would be appreciated.
      >
      > I know you can only send one letter at a time.
      >
      > Thanks in advance!
      >
      > Rob
      >
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]



      Yahoo! Groups Sponsor

      ADVERTISEMENT

      <http://us.ard.yahoo.com/SIG=1293586lr/M=295196.4901138.6071305.3001176/D=gr
      oups/S=1705006951:HM/EXP=1090488476/A=2128215/R=0/SIG=10se96mf6/*http://comp
      anion.yahoo.com> click here

      <http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=
      :HM/A=2128215/rand=781724395>


      _____

      Yahoo! Groups Links


      * To visit your group on the web, go to:
      http://groups.yahoo.com/group/perlguitest/
      <http://groups.yahoo.com/group/perlguitest/>


      * To unsubscribe from this group, send an email to:
      perlguitest-unsubscribe@yahoogroups.com
      <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>


      * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
      <http://docs.yahoo.com/info/terms/> .




      [Non-text portions of this message have been removed]
    • Show all 9 messages in this topic