@@ -0,0 +1,1569 @@
+package cologne.eck.peafactory.tools;%0A%0A/*%0A * Collects time values from key strokes%0A * %0A * Copyright (C) 2015  Axel von dem Bruch%0A * %0A * This library is free software; you can redistribute it and/or modify it %0A * under the terms of the GNU General Public License as published %0A * by the Free Software Foundation; either version 2 of the License, %0A * or (at your option) any later version.%0A * This library is distributed in the hope that it will be useful, but %0A * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY %0A * or FITNESS FOR A PARTICULAR PURPOSE. %0A * See the GNU General Public License for more details.%0A * See:  http://www.gnu.org/licenses/gpl-2.0.html%0A * You should have received a copy of the GNU General Public License %0A * along with this library.%0A */%0A%0A/**%0A * This class collects random values from key stroke events. %0A * %0A * %09Values are not the keys itself but the time between typing. %0A * %09For every key event a thread of EntropyPool is updated with this time value. %0A * %0A */%0A%0Aimport java.awt.event.KeyAdapter;%0Aimport java.awt.event.KeyEvent;%0A%0A%0A%0Apublic class KeyRandomCollector extends KeyAdapter%7B%0A%09%0A%09private transient long start;%0A%0A%09public KeyRandomCollector() %7B%0A%09%09start = System.currentTimeMillis();%0A%09%7D%0A%09%0A%09@Override%0A%09public void keyPressed(KeyEvent kpe) %7B%0A%0A%09%09EntropyPool.getInstance().updateThread(System.currentTimeMillis() - start);%0A%09%09%0A%09%09// for tests only:%0A%09/*%09System.out.println(%22%5Cn keyPressed: %22 %0A%09%09%09%09+ (System.currentTimeMillis() - start) %0A%09%09%09%09+ %22 event: %22 + eventCounter++); */%0A%09%09start = System.currentTimeMillis(); %09%09%0A%09%7D%0A%7D%0A

Create KeyRandomCollector.java