how to disable ctrl + c key in ruby on rails

S

Sujith Gangaraju

I am showing document in browser
i want to disable the copy option ctrl + c key in ruby
please help me out
 
R

Roger Pack

Sujith said:
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/roger/?p=110

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?
 
F

Florian Gilcher

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


Might work to do it the traditional Ruby way:

http://betterlogic.com/roger/?p=3D110

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-forum.com/.

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-----
 
E

Eleanor McHugh

Might work to do it the traditional Ruby way:

http://betterlogic.com/roger/?p=3D110

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-brains.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top