librelist archives

« back to archive

key release event

key release event

From:
Eduard Oliver
Date:
2012-09-03 @ 15:16
Hi all!

Is it possible to capture key release events on shoes?

I am able to capture key press events with this:

    keypress { |k| k = k.downcase.to_sym; dir = k if pos.keys.include? k}

but is there a way to know when the key has been released?

Thank you
Eduard

Re: [shoes] key release event

From:
ashbb
Date:
2012-09-04 @ 12:17
Hi Eduard,

Try out the keyup method. Not mentioned in the Shoes manual, though...

Shoes.app do
  keyup do |k|
    para k
  end
end

I confirmed with Shoes 3 (0.r1514) on my Windows 7.
But I'm not sure it works on other platforms.

Regards,
ashbb

Re: [shoes] key release event

From:
Eduard Oliver
Date:
2012-09-08 @ 09:13
Thank you ashbb ! It works for me as well when using Shoes 3 (0.r1514). I
also tried with green_shoes but it is not recognized there.

On 4 September 2012 13:17, ashbb <ashbbb@gmail.com> wrote:

> Hi Eduard,
>
> Try out the keyup method. Not mentioned in the Shoes manual, though...
>
> Shoes.app do
>   keyup do |k|
>     para k
>   end
> end
>
> I confirmed with Shoes 3 (0.r1514) on my Windows 7.
> But I'm not sure it works on other platforms.
>
> Regards,
> ashbb

Re: [shoes] key release event

From:
ashbb
Date:
2012-09-08 @ 23:10
Hi Eduard,

> I also tried with green_shoes but it is not recognized there.
Oh! Sorry, Green Shoes has not yet supported keyup method. :-P

If you want, feel free post the request on github:
https://github.com/ashbb/green_shoes/issues

Cheers,
ashbb