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

88Re: keypress

Expand Messages
  • amorphis_bwd
    May 22, 2002
    • 0 Attachment
      Thanks for that. i installed it using ppm cos nmake seems to crash
      when its compiling something that uses xs. anyway, i've run into a
      little bit of a problem. what i'm trying to do with iskeypressed is
      use it as a replacement for accelerators cos i'm using win32::gui and
      accelerators don't work in the current version. so the script kinda
      goes like this..

      use Win32::GuiTest qw/IsKeyPressed/;


      $Timer = new GUI::Timer("Timer",1); #1ms break betwenn running the
      _timer event

      sub Timer_Timer {
      if (IsKeyPressed("s")) {
      &Settings_Click;
      }
      }

      and so on and so forth. when i run it it tells me undefined
      subroutine &main::IsKeyPressed, but it obviously find Win32::GuiTest
      otherwise we wouldn't get to that point. any ideas as to what
      happening? also does iskeypressed handle things like alt+s?

      --- In perlguitest@y..., "erngui" <erngui@a...> wrote:
      > Hi,
      >
      > --- In perlguitest@y..., "amorphis_bwd" <sepal@h...> wrote:
      > > hi. i'm trying to get keypress to recognise normal a-z characters
      > but
      > [...]
      > > tell me what i'm doing wrong?
      >
      > You did nothing wrong. The version IsKeypressed that I uploaded
      only
      > supports "special" keys. That means it understands the same things
      as
      > SendKeys does "F11", "BS", "ENTER", etc.
      >
      > I've just uploaded a fix:
      > http://groups.yahoo.com/group/perlguitest/files/Win32-GuiTest-
      > 1.49.1.zip
      >
      > These are the changes I made to guitest.xs and eg/keypress.pl.
      >
      > diff -r1.13 GuiTest.xs
      > 959a960,961
      > > else if (strlen(name)==1 && (isdigit(*name) || isalpha
      (*name)))
      > > RETVAL = GetAsyncKeyState(toupper(*name));
      >
      > diff -r1.3 keypress.pl
      > 10c10
      > < @keys = qw/ESC F5 F11 F12/;
      > ---
      > > @keys = qw/ESC F5 F11 F12 A B C/;
      >
      > Now you should be able to do:
      >
      > IsKeyPressed("A");
      > IsKeyPressed("7");
      >
      > Regards,
      > Ernesto.
      > --
      > Ernesto Guisado
      > mailto:erngui@a...
      > http://triumvir.org
    • Show all 4 messages in this topic