Keyboard while typing
De DigiWiki.
Ok, so here's my first addition to the library. Feedback welcome. bugs? Poor choice of implementation? Contact me in world. Yes, I know it's commenty, but the comments aren't for you 733T 5cr!pt3r5 - it's to help newer people navigate, explain what's what - you don't need this script, anyway. XD
You can drop this in a rectangular prim and it should work.
Thanks to Strife for pointers/cleanup.
// Max Case's Free Keyboard Script 1.0 04/18/2005 // Put it in a prim, attach it to yourself (or not) and watch as a keyboard magically appears whenever you type. // Feel free to reuse, etc. // Please don't just resell this script. That would be lame, since I am giving it to you for free. // naturally, if you build something nice off of it, sell that. // Or make a nice texture you would like to sell with keyboard script, that's ok. Just leave script open to all to see. // Feedback/Rates/Donations/Hate Mail always welcome. Don't be shy. // leave in the comments. they don't affect performance, and they are meant to help other beginners learn about LSL. // - Max // 25.03.2007 This was written before things like CHANGED_OWNER, and before I knew what I was doing :) Dusting it off. integer keyboard_status; //Used to track if the keyboard is visible or not. key kbTexture = "eef62334-e85e-b8f5-0717-19056bdbafde"; integer box_face = 0; //What side to show the keyboard. 0 means Top initialize() { llSay(0, "Welcome to Max's Symple Keyboard."); //You can change the welcome messages here. llSay(0, "initializing..."); llSetTexture(kbTexture, box_face); //Setting the Keyboard Texture llSetTextureAnim(ANIM_ON | LOOP, box_face, 4, 1, 0, 0, 4); //Set the typing animation llSetAlpha(0.0, ALL_SIDES); //Hide the keyboard. llSetTimerEvent(.5); //honestly you could make this shorter, but what would be the point? .5 seems to work nice. keyboard_status = FALSE; //Keep track of the keyboards visibility. } default { state_entry() { initialize(); } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } timer() { // are we typing? Well? Are we??? thanks to Strife for rewrite here. integer are_we_typing = llGetAgentInfo(llGetOwner()) & AGENT_TYPING; if (keyboard_status != are_we_typing ) { //keyboard_status changed since last checked? llSetAlpha(!keyboard_status, box_face);//flip the keyboard_status keyboard_status = are_we_typing;//save the current keyboard_status. } } }


