[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to disable ctrl + c key in ruby on rails

Sujith Gangaraju

7/25/2008 5:15:00 AM

I am showing document in browser
i want to disable the copy option ctrl + c key in ruby
please help me out
--
Posted via http://www.ruby-....

3 Answers

Roger Pack

7/25/2008 5:20:00 AM

0

Sujith Gangaraju wrote:
> I am showing document in browser
> i want to disable the copy option ctrl + c key in ruby
> please help me out

Might work to do it the traditional Ruby way:

http://betterlogic.com/ro...

windows:
trap :INT, proc { â??ha got your ctrl-c!â?? }

and linux

trap â?SIGUSR1â?³, proc {â??got it in linux, tooâ??}

I think. Maybe add to environment.rb?
--
Posted via http://www.ruby-....

Florian Gilcher

7/25/2008 8:29:00 AM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Jul 25, 2008, at 7:19 AM, Roger Pack wrote:

> Sujith Gangaraju wrote:
>> I am showing document in browser
>> i want to disable the copy option ctrl + c key in ruby
>> please help me out
>
> Might work to do it the traditional Ruby way:
>
> http://betterlogic.com/roge...
>
> windows:
> trap :INT, proc { =E2=80=98ha got your ctrl-c!=E2=80=99 }
>
> and linux
>
> trap =E2=80=9DSIGUSR1=E2=80=B3, proc {=E2=80=99got it in linux, =
too=E2=80=99}
>
> I think. Maybe add to environment.rb?
> -- =20
> Posted via http://www.ruby-....
>

As I see it: he doesn't want the user to copy text.

Not the answer you might expect: don't even try. You showed him the =20
text. If he is serious, he will use the old analog method of copying.

Regards,
Florian Gilcher
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkiJkAEACgkQJA/zY0IIRZaWTwCdGtDS/hlMtDqQr9pfWevYGQ6s
xQkAnitMod6+mKZ0IgYV0syJyPM3Uosc
=3D/UlL
-----END PGP SIGNATURE-----

Eleanor McHugh

7/25/2008 8:31:00 AM

0

On 25 Jul 2008, at 06:19, Roger Pack wrote:
> Sujith Gangaraju wrote:
>> I am showing document in browser
>> i want to disable the copy option ctrl + c key in ruby
>> please help me out
>
> Might work to do it the traditional Ruby way:
>
> http://betterlogic.com/roge...
>
> windows:
> trap :INT, proc { =E2=80=98ha got your ctrl-c!=E2=80=99 }
>
> and linux
>
> trap =E2=80=9DSIGUSR1=E2=80=B3, proc {=E2=80=99got it in linux, =
too=E2=80=99}
>
> I think. Maybe add to environment.rb?

That would stop the Rails application from processing a ctrl-c on the =20=

server keyboard (if it has one) but would make no difference in the =20
browser as the Ruby code doesn't run there.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-...
----
raise ArgumentError unless @reality.responds_to? :reason