On Dec 2, 1:30 pm, "dracogni...@gmail.com" <dracogni...@gmail.com>
wrote:
> On Dec 2, 1:18 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
> wrote:
>
>
>
> > dracogni...@gmail.com a écrit :
>
> > > On Dec 2, 6:47 am, halbe...@gmail.com wrote:
> > >> Is this possible with Javascript in anyway? 
>
> > > Yes, it is possible to detect a paste action.
> > > Here's a simple exemple, preventing to paste in a textarea :How do you expect to tape 'v' ? or 'V' ?
>
> > Anyway,
> > that doesn't work at all !
>
> > report under textbox tells me : 224 224
>
> > --
> > Stephane Moriaux et son (moins) vieux Mac déjà dépassé
> > Stephane Moriaux and his (less) old Mac already out of dateOups... You're totally rights... >_<
> I'm sorry i wasn't careful enough about that...
>
> I'm going to see if I can do something about it 
>
> P.S. Ton mac est si vieux ?
>
> --
> Naixn.
<script>
window.addEventListener('load', function (e)
{
document.getElementById('text').addEventListener(' keydown', function
(e)
{
if (e.keyCode == 86 && e.ctrlKey) //86 is 'v' char key
{
e.preventDefault();
}
document.getElementById('events').innerHTML += e.keyCode + ' ' +
e.which + '<br />';
}, false);
}, false);
</script>
Here it is.
I forgot to put the "e.ctrlKey" check ( to check wether control key was
pressed, or not.
Thing is I don't have any way to try javascript on Safari ( as there's
no JavaScriptCore port on Linux, apart from KHTML, which begins to
differs a lot from WebCore... ).
What is 224 ? Ctrl+V keycode, or V keycode ?
Is the e.ctrlKey working with safari ? Since I know you have to "pomme
+ v" to paste ( sorry I don't remember the english equivalent for
'pomme' [ I just know it's not " Apple "

] ).
--
Naixn.