• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Handling keydown and keypress events

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
4 posts • Page 1 of 1

Postby udvranto » Mon Jun 25, 2007 9:50 pm

Hi,
We are trying to use a phpfreechat on a localized version of Drupal. We need to hook the keyboard events from the chat textarea so that we can use our existing javascript code for local language input. Where is the textarea initialized? How can I hook it?

Thanks in advance.
udvranto
Member
 
Posts: 15
Joined: Mon Jun 25, 2007 4:45 am
Top

Postby udvranto » Tue Jun 26, 2007 10:47 pm

In themesdefaultchat.js.tpl.php I added the keyboard handler js files

Code: Select all
<script type="text/javascript" src="http://www.myhost.com/next/common.js"></script>
<script type="text/javascript" src="http://www.myhost.com/next/cookies.js"></script>
<script type="text/javascript" src="http://www.myhost.com/next/layout.js"></script>

In themesdefaultchat.html.tpl.php I added the keyboard handler
Code: Select all
      <td class="pfc_td2">
        <input type="text"
               id="pfc_words"
               title="<?php echo _pfc("Enter your message here"); ?>"
               maxlength="<?php echo $max_text_len; ?>"
               style="font-size:16px;""
               onkeydown="return KeyBoardDown(event);"
               onkeypress="return KeyBoardPress(event);"/>
      </td>

I can see it from "firebug" firefox extension but its not working. Any clue?

I have scripts disabled in my drupal filter.
udvranto
Member
 
Posts: 15
Joined: Mon Jun 25, 2007 4:45 am
Top

Postby phpfreechat » Sat Jun 30, 2007 7:27 pm

onkeydown onkeypress events are registred in data/public/js/pfcclient.js

Maybe it overloads yours ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby udvranto » Fri Jul 06, 2007 6:04 am

Thank you very much kerphi. That was it. I simply called my keyboard handler function after the special keys were taken care of in pfcclient.js. And it just worked. :D

You made my day.
udvranto
Member
 
Posts: 15
Joined: Mon Jun 25, 2007 4:45 am
Top


Post a reply
4 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 3 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub