Keyboard Issues

Dear Sir,
This is error what i have.please give me some suggestion. how i use my keyboard for multiple input box.

that is code

  $(function(){
	var $write = $(':input'),		
	shift = false,
	capslock = false;
	backspace  = false;
$('#keyboard li').click(function(){
	var $this = $(this),
		character = $this.html(); 
	
	// Shift keys
	if ($this.hasClass('left-shift') || $this.hasClass('right-shift')) {
		$('.letter').toggleClass('uppercase');
		$('.symbol span').toggle();

		shift = (shift === true) ? false : true;
		capslock = false;
		backspace  = false;
		return false;
	}

	// Caps lock
	if ($this.hasClass('capslock')) {
		$('.letter').toggleClass('uppercase');
		capslock = true;
		return false;
	}

	// backspace lock
	if ($this.hasClass('backspace')) {
		$('.letter').toggleClass('uppercase');
		capslock = true;
		return false;
	}

	// Delete
		if ($this.hasClass('delete')) {
			var html = $write.html(),
			txt = html.substr(0, html.length - 1);
		  $write.html(txt);
		  $write.autocomplete("search", txt);
		  return false;
		}
		// Delete

	// Special characters
	if ($this.hasClass('symbol')) character = $('span:visible', $this).html();
	if ($this.hasClass('space')) character = ' ';
	if ($this.hasClass('tab')) character = "\t";
	if ($this.hasClass('return')) character = "\n";

	// Uppercase letter
	if ($this.hasClass('uppercase')) character = character.toUpperCase();

	// Remove shift once a key is clicked.
	if (shift === true) {
		$('.symbol span').toggle();
		if (capslock === false) $('.letter').toggleClass('uppercase');

		shift = false;
	}
	//console.log("DO IT ", character);
	// Add the character
	$write.val($write.val() + character);		
    $write.html(txt);
    $write.autocomplete("search", txt);
	
	
});	

});
 $(function () {
	 var write = write();
     write.init("keyboard");

     //first input focus
     var $firstInput = $(':input').first().focus();
     write.currentElement = $firstInput;
     write.currentElementCursorPosition = 0;
 });

what is the issue?? Does typing in one input box gets text on all input box??

1 Like

yes sir i am facing same problem.please do something in my code.
(what is the issue?? Does typing in one input box gets text on all input box??)

Too tired now to analyse your code but it may be an event bubbling effect. Maybe this article can help.

Another medium article on the subject.

1 Like

check my this code may be now you could help me

Dear sir,
Thank your sir ,
For check my code now i just some changes in my code now what things need to be added.