Demo entry 6338978

entree Clavier

   

Submitted by adrien on Dec 18, 2016 at 15:26
Language: Java. Code size: 744 Bytes.

public static void createKeyboardHandler(RealtimeThread tache){
		// Creation AEH
		KeyboardAEHHandler clavierHandler = new KeyboardAEHHandler ();
		clavierHandler.setThread(tache);
	       
		// A COMPLETER AVEC VOTRE ACQUISITION CLAVIER...
		
		AsyncEvent eventClavier = new AsyncEvent();
		eventClavier.addHandler(clavierHandler);
		
		InputStreamReader isr;
		BufferedReader br;
		
		 

		while(true)
		{
		   	    
			try {
			 
			   isr=new InputStreamReader(System.in);
			   br=new BufferedReader(isr);
			   buffer = br.readLine();		      
			   System.out.println("Keyboard input received");
			   clavierHandler.setEntree(buffer);
			   eventClavier.fire();
			
			} catch (IOException ioe) { }
		}

	}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).