Click to See Complete Forum and Search --> : A script requested Urgently


Sinyoreta
05-27-2003, 09:17 AM
Hi there everybody,

Would you plzzzzz help me with desiginig a script as following:

Design a computer keyboard layout, such that each push of a button on the keyboard will invoke a function that will execute the letter/number residing on that particular key; in addition to that observe the following:

1- Use a JavaScript script that will emulate a computer keyboard that has full functionality (Numbers, letters, special symbols, etc)
2- Use the appropriate the Cascading styles (in and external file) and link them to your main file.
3- Make sure you comment every line of your code.
4- Your keyboard should have a screen of its own where the result of pushing the consecutive buttons will display in it..

That's all..

i would really really appreciate it if you could help me with this as soon as possible. :confused:

Vladdy
05-27-2003, 09:25 AM
Sounds like a homework assignment to me...

BestZest
05-27-2003, 09:43 AM
I have to agree with Vladdy. And anyways, I think of this BBS as a place to help and be helped, not somewhere for novices to ask for giant complete scripts, that they havn't got the motivation to write. I learnt almost everything I know about JavaScript from the internet, and then bought a book, if I can do it, so can you. This isn't a personal attack on you Sinyoreta, but I find these requests too often I think.

http://javascript.internet.com
http://webdeveloper.earthweb.com/webjs/
http://www.webmonkey.com

BestZest

cmelnick
05-27-2003, 09:54 AM
My favorite parts are:

3- Make sure you comment every line of your code.
and
That's all..

Nevermore
05-27-2003, 11:58 AM
Is this what you mean?

http://www.evernet.co.uk/testing/keyboard.htm

You will need a username and password to access it - the username is User and the password is browse (case sensitive). I just put the prompt their to keep people from going through things I'm testing and emailing me about them.
The source is commented, and it has an onscreen keyboard as well as responding to keys being pressed, because I wasn't entirely sure what you wanted. I have also attached the files for your convenience. The style is in the file letterstyle.css, and is very basic.
If you are doing this for a school or college project, then tell me and I will keep the files off my site for a couple of weeks, just in case.

brendandonhue
05-27-2003, 03:53 PM
Originally posted by cmelnick
My favorite parts are:


and
Yup I enjoyed those parts too :D

Now, if this is a homework assignment, what have you been doing during that class that you can't even start coding yourself?
Actually,this wouldn't be that hard, but I will not do your HW for you. Just ask if there is any particular part you get stuck on.

kurtatwork
05-27-2003, 04:09 PM
Originally posted by Vladdy
Sounds like a homework assignment to me...

Give that man a cigar.

A lot of us may have been born at night, but it wasnt last night.

;)

Nevermore
05-27-2003, 04:15 PM
Even a fully made solution (lie I may have given, I didn't really understand what he/she wanted) will still require some learning on their part. For instance, I used regular expressions to check for different types of character, so they will have to be learnt or it will look like the code was just taken from somewhere else. Also, I didn't make a whole keyboard (no space for a start), so they will hopefully learn as they expand it.

Sinyoreta
05-28-2003, 01:47 AM
I would really want to thank everybody for making fun of me. :( .but lemme clear things out, Yes this is an assignment required out from me and it counts alot of points and i couldn't do it because i hate programming and not planning to work in any programming field so no need for me to learn it although i do want to and i tried hard.:confused: You might wonder why did i study this major then?!!! well i didn't major in programming, i majored in Info Systems and in our schools they give us general IS not specific majors.
Moreover, i am about to graduate and my graduation degree depends on this course and in particular on this assignment. Thanx once again but i didn't meant to say that you were born yesterday's night with my assignment and i forgot to mention that it's an assignment in fact i just needed help.:(
Thanx alot "cijori" for your help and i really appreciate it 4 u. I will try my best to expand it. Thanx:)

Regards,
Sinyoreta

Nevermore
05-28-2003, 02:29 AM
If you need any more help just ask.

Sinyoreta
05-28-2003, 04:16 AM
Hi there,

Attached is what i did so far but i still need your help Cijori with something more that is how to assign values to the follwoing Characters:

Enter, Ctrl, Alt, Backspace and Shift

Thanx alot

Yours,
Sinyoreta

Nevermore
05-28-2003, 04:49 AM
I don't really understand what you mean. Do you want to be able to press backspace etc. on a real keyboard and have it delete one character, or are you trying to make the clickable versions of them work?

Sinyoreta
05-28-2003, 05:11 AM
Lemme make it clear to you:
I am trying to make the clickable versions of them work, the ones that are in the HTML file i attached previously named "keyboard1.html".
Is it possile?!!

Nevermore
05-28-2003, 05:19 AM
Yeah, that's possible. I've got the shift key capitalizig the next letter you input. But... what do you want the ctrl and alt keys to do? I've put a little display in the top left that tells you that they are on, but what else can they do?

Sinyoreta
05-28-2003, 05:28 AM
Well, i don't really know. You know what, forget about it. It's not even required.

Thanx any how

Sinyoreta
05-28-2003, 05:30 AM
But the only ones i need are the Enter key to enter a new line and the backspace key to delete unwanted letters plus the Shift key

Will you help me with that?!

Nevermore
05-28-2003, 05:34 AM
Already done. Plus, I added a little thing to tell you if shift/ctrl/alt are pressed. Backspace works. Enter goes onto a new line. Just thinking, though, you might want to add a space bar...

Shift capitalizes the next letter you type. CTRL and ALT do nothing except tell you that they are on.

Sinyoreta
05-28-2003, 05:48 AM
Yeah that would be great to add a space bar or a Tab key. i added the key already but how to make it work

Nevermore
05-28-2003, 06:00 AM
Here you go. The space bar works and I added a tab key that adds 4 spaces. I know it's in a bit of a strange position, but it was too wide to go at the left. Still, you can put it where you want.
You might want to make sure you know how everything in the script works, just in case. I don't know, but you might not have covered regular expresions or nodes.

Sinyoreta
05-28-2003, 06:19 AM
Thanx alot, you've been a great help to me. But i don't have any idea about regular expresions or nodes and i think that i need to know how everything in the script works in case i've been asked about it and to satisfy my curiousity. So would you please explain to me in a simple and breaf way.

Thanx alot once again
:)

Nevermore
05-28-2003, 06:36 AM
Nodes are bits of a document. You can use them to update content dynamically. To get the text in an element you would use document.getElementById(‘id’).firstChild.nodeValue. You can change the text in an element (e.g. a span tag) by using this and changing nodevalue. This is what I have used to update the little display thing in the top left corner.
Regular expressions are used to match text that can change significantly. They are sort of like wildcards, but more powerful. You can create a regular expression using name=/<-insert expression here->/ - the forward slashes are used to denote that it is a regular expression not just a string, number or boolean. Regular expressions can use ranges of values - e.g.[a-z] would match all of the lettters in the alphabet. RegExp ranges are enclosed in square brackets. You can also use multiple ranges, e.g. [a-zA-Z0-9] would match all letters of both cases and all numbers. To check if a string matches a regular expression, you use regexpname.test(string). You can use this as the condition in an if statement, as I have used to check for letters in the keyboard. That's all you need to know about regExps to have made the script.
I assume you are familiar with switch statements and keydown event handlers; if not, I can explain them.

If you just flick through the code you can ask me about anything you don't understand.

Nevermore
05-28-2003, 06:40 AM
I don't mean to be rude and you don't have to answer if you don't want to, but what level are you writing this for (e.g. what age range or what qualification)?

Sinyoreta
05-28-2003, 06:52 AM
It's ok ...i am in my forth year in the university majoring in Information Systems. and this assignment is for a course titled Advanced Web Programming. I am 22 years old:o

Sinyoreta
05-28-2003, 06:57 AM
Thanx Dave for everything and i think i will go with that. I'll do my best and with your help i am sure i can do it.:)

Nevermore
05-28-2003, 07:19 AM
I made a few changes to the code, such as adding the none-standard attribute unselectable="on" to make the keyboard text unselectable in IE and I added some cell padding to give you a slight margin for error when trying to click the letter names. I hope you don't mind.
p.s. the unselectable attribute doesn't make it unselectable, it just stops it being selected by double clicking.

Sinyoreta
06-07-2003, 03:40 AM
Hi Cijori,
I hope u r doing fine.
I changed the Caps button place in the keyboard but couldn't be able to function it. Would you help me with that please?!!
Regards,
Lubna:confused:

Sinyoreta
06-07-2003, 03:42 AM
Here is the file , i forgot to attach it previously:p

Nevermore
06-07-2003, 01:47 PM
Here you go. Hope this is what you wanted. Sorry I didn't reply sooner, my phonelines were down.

Sinyoreta
06-08-2003, 03:45 PM
Thanx alot Cijori. It's exactly what i wanted. I am submitting it Tommorow. Wish me Luck ;)

and Thanx once again for everything.

:o

Regards,
Sinyoreta

Nevermore
06-11-2003, 11:03 AM
I hope you do well.