Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

German keyboard layout #21

Open
GoogleCodeExporter opened this issue Mar 24, 2015 · 1 comment
Open

German keyboard layout #21

GoogleCodeExporter opened this issue Mar 24, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 25 Sep 2014 at 1:54

Attachments:

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 25 Sep 2014 at 2:02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant