Rosengren / windowlicker

Automatically exported from code.google.com/p/windowlicker
GNU General Public License v3.0
0 stars 0 forks source link

German keyboard layout #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run a WindowLicker test on a German PC.

What is the expected output? What do you see instead?
I get this warning:
WARNING: could not load keyboard layout DE, using fallback layout with reduced 
capabilities (...)

What version of the product are you using? On what operating system?
I am using windowlicker r268 on Windows 7 64 bit.

Please provide any additional information below.
Attached is a keyboard layout for DE that I created. Please integrate it into 
the next build, if possible. Thanks!

Original issue reported on code.google.com by Alexande...@gmail.com on 25 Sep 2014 at 1:54

Attachments:

GoogleCodeExporter commented 9 years ago
If anyone else wants to create a new keyboard layout for WindowLicker, here is 
a little tool I wrote for easily finding the KeyEvent constants:

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.lang.reflect.Field;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;

public class TestKeyEvent {
  public static void main(final String... args) {
    JFrame jFrame = new JFrame();
    jFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    jFrame.addKeyListener(new KeyAdapter() {
      @Override
      public void keyPressed(final KeyEvent e) {
        try {
          int keyCode = e.getKeyCode();
          for (Field field : KeyEvent.class.getDeclaredFields()) {
            if (!field.getName().startsWith("VK_") || field.getType() != int.class) {
              continue;
            }
            if (keyCode == field.getInt(null)) {
              System.out.println(field.getName().substring(3));
            }
          }
        } catch (IllegalArgumentException | IllegalAccessException e1) {
          e1.printStackTrace();
        }
      }
    });
    jFrame.add(new JLabel("Look a console for output!"));
    jFrame.pack();
    jFrame.setLocationRelativeTo(null);
    jFrame.setVisible(true);
  }
}

Original comment by Alexande...@gmail.com on 25 Sep 2014 at 2:02