Esempio n. 1
0
 public static function inputFromDevice($deviceID)
 {
     if ($deviceID == 1) {
         Mouse::recieveInput();
     }
     if ($deviceID == 2) {
         Keyboard::recieveInput();
     }
 }
Esempio n. 2
0
 public function visitKeyboard(Keyboard $keyboard)
 {
     echo "hello, " . $keyboard->getName() . "\n";
 }
<?php

require_once "./Keyboard.class.php";
$keyboard = new Keyboard();
$keyboard->setUseOnlyInCS(false);
$div_keyboard = $keyboard->draw();
?>

 <?php 
error_reporting(0);
session_start();
include_once '../oesdb.php';
/***************************** Step 2 ****************************/
if (isset($_REQUEST['admsubmit'])) {
    $result = executeQuery("select * from adminlogin where admname='" . htmlspecialchars($_REQUEST['name'], ENT_QUOTES) . "' and admpassword='******'password'], ENT_QUOTES)) . "'");
    // $result=mysql_query("select * from adminlogin where admname='".htmlspecialchars($_REQUEST['name'])."' and admpassword='******'password']))."'");
    if (mysql_num_rows($result) > 0) {
        $r = mysql_fetch_array($result);
        if (strcmp($r['admpassword'], md5(htmlspecialchars($_REQUEST['password'], ENT_QUOTES))) == 0) {
            $_SESSION['admname'] = htmlspecialchars_decode($r['admname'], ENT_QUOTES);
            unset($_GLOBALS['message']);
            header('Location: index.php');
        } else {
            $_GLOBALS['message'] = "Check Your user name and Password.";
        }
    } else {
        $_GLOBALS['message'] = "Check Your user name and Password.";
    }
    closedb();
}
?>
    {
        $this->buildDiv();
        $this->buildScript();
        return $this->div . "\n" . $this->script;
    }
}
if (isset($_POST['build'])) {
    if ($_POST['build'] == "main") {
        $clavier = new Keyboard();
        $clavier->setMode($_POST['mode']);
        $clavier->setLineHeightImage($_POST['line_height_image']);
        // Inutile car on considère que si on peut changer de mode
        // c'est que le clavier peut afficher toutes les touches
        //$clavier->setConstraint($_POST['constraint']);
        echo $clavier->buildMainKey();
    } else {
        if ($_POST['build'] == "global") {
            $clavier = new Keyboard();
            $clavier->setWidth($_POST['width']);
            $clavier->setMode($_POST['mode']);
            $clavier->setMajmin($_POST['majmin']);
            $clavier->setConstraint($_POST['constraint']);
            $clavier->setLineHeightImage($_POST['line_height_image']);
            $clavier->setCloseWidth($_POST['close_width']);
            $clavier->setMargeAroundKeyboard($_POST['marge_around_keyboard']);
            $clavier->setModeInactive($_POST['mode_inactive']);
            $clavier->setMajminInactive($_POST['majmin_inactive']);
            echo $clavier->buildGlobalKey();
        }
    }
}
Esempio n. 5
0
<?php

include 'keyboard.class.php';
$keyboard = new Keyboard();
$sentence = 'find the optimum path for this sentence';
if (isset($_REQUEST['input'])) {
    $sentence = $_REQUEST['input'];
}
$output = $keyboard->findOptimumPath($sentence);
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Remote Keyboard</title>
	<script src="js/bootstrap.min.js" type="text/javascript"></script>
	<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
</head>
<body>
	<div class="container">
	<div class="page-header">
	  <h1>Question 2:<small> Speed typing !</small></h1>
	</div>
	  
	  <div class="row">
	  	<div class="col-md-12">
		  	<form role="form">
			  <div class="form-group">
			    <label for="exampleInputEmail1">Input</label>
			    <input type="text" name="input" class="form-control" id="exampleInputEmail1" placeholder="Enter sentance" 
					value="<?php