How can I create a fake shell command line that looks like this?
I really love the thought of having a JavaScript shell command line but I only know php, mysql, html, and css. I've never really liked JS cause it differs from browser to browser.
But anyways how can I create a very simple basic fake shell command line like this real one located here: TermShell
i only know javascript. i can make a fake shell just like that using canvas and context.text command in html5.
Why do you want a Fake shell? to trick someone into entering a password?
i only know javascript. i can make a fake shell just like that using canvas and context.text command in html5.
Why do you want a Fake shell? to trick someone into entering a password?
Well I want you to do it in JavaScript, and no I'm not a bad person wanting to steal someones stuff.
I'm wanting to make my website to be a shell terminal where the user has to type in commands to go to different pages or to submit stuff so it will make it seem like they are on a computer terminal.
@Woodstock Im trying rnd-me's terminal and doesnt work for me either. Code looks as if it should return a date, or clear screen if I type either date: or CLS: but it doesnt work?
Anyway can someone look at my version please and tell me how to convert the keycode into a character for output because mine has a bug too
OP Subless didn't thank me for my brilliant effort, nor has anyone helped with the small issue of converting the keypress code back to a character which is the only bit that doesnt work in my demo - which I have ASKED ABOUT TWICE.
VIPStephen was quick enough to tell me I cant have an avatar yet but when I put some effort in I dont get any acknowledgement
is probably what you are looking for. It is not 100% reliable, though, as there is not a direct correspondence between the key-codes returned by JS and the unicode character-codes that fromCharCode() expects. (It can also depend on which key-event is used.)
BTW You will discover that you cannot expect an acknowledgement every time, even if you provide a full and correct answer to someone's question
Quote:
which I have ASKED ABOUT TWICE
..you also cannot demand an answer.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
hey String.fromCharCode(evt.keyCode) works, well sort of - except I get capital letters all the time and a few funny characters. Why do little letters not show even when Im not pressing shift?
The only other problem is I tried to add a line to catch the backspace to allow deletion of characters
Code:
if(evt.keyCode==8){ cursX-=8; return;}
but it just exits the browser!!
That seems to be a quirk of GoogleChrome, dont know why they picked the delete key to also go back, is there an easy way to stop that?
event.shiftKey may enable you to distinguish between capital and lowercase - depending on the key event you use (I haven't clarified this fully but believe this applies to keydown). You then could use toLowerCase() to output the correct character, or add 32 to the key-code.
Quote:
a few funny characters
..depends on what key was pressed..
I always use Backspace to return to the previous page (Back) - on all browsers. To prevent this action you either need to return false from your event (which should work on its own) or event.preventDefault() as well.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS