Hello, so I wanted to run a program a created a few years ago. But it no longer took any input from the keyboard at all. So I decompiled it, and well its still doesnt work.

I think the problem is here

			System.out.println("wtf");
/*  76 */     kfm.addKeyEventDispatcher(new KeyEventDispatcher()
/*     */     {
/*     */       public boolean dispatchKeyEvent(KeyEvent e)
/*     */       {
				System.out.println("wtf2");
/*  82 */         if (e.getID() == 401)
/*     */         {
/*  84 */           Main_Window.this.themodel.handleKeyBoardPressed(e);
/*     */         }
/*  86 */         if (e.getID() == 402)
/*     */         {
/*  88 */           Main_Window.this.themodel.handleKeyBoardReleased(e);
/*     */         }
/*     */ 
/*  92 */         e.consume();
/*  93 */         return true;
/*     */       }
/*     */     });
as the program will write wtf but not wtf2, no idea why it doesn't work.


Full code

/*     */ public class Main_Window
/*     */ {
/*     */   private Model themodel;
/*     */   private long fpstimer;
/*     */   private Window myWindow;
/*     */   private GraphicsDevice gd;
/*     */   private Frame frame;
/*     */   private BufferStrategy strategy;
/*     */   private int screenwidth;
/*     */   private int offsetx;
/*     */   private int offsety;
/*     */   private int screenheight;
/*     */   private Rectangle resolution;
/*     */ private KeyboardFocusManager kfm;
/*     */   public static void main(String[] args)
/*     */   {
/*  41 */     Main_Window window = new Main_Window();
/*  42 */     window.theGame();
/*     */   }
/*     */ 
/*     */   Main_Window()
/*     */   {
/*  52 */     GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
/*  53 */     this.gd = ge.getDefaultScreenDevice();
/*     */ 
/*  55 */     this.frame = new Frame(this.gd.getDefaultConfiguration());
/*     */ 
/*  57 */     this.resolution = new Rectangle();
/*  58 */     this.resolution.x = 1200;
/*  59 */     this.resolution.y = 900;
/*  60 */     this.myWindow = new Window(this.frame);
/*     */ 
/*  63 */     this.themodel = new Model();
/*  64 */     this.themodel.Set_camera_width_height(this.resolution.x, this.resolution.y);
/*     */ 
/*  67 */     this.gd.setFullScreenWindow(this.myWindow);
/*     */ 
/*  70 */     this.myWindow.requestFocus();
/*  71 */     this.myWindow.requestFocusInWindow();
/*  72 */     int numBuffers = 2;
/*  73 */     this.myWindow.createBufferStrategy(numBuffers);
/*  74 */     this.strategy = this.myWindow.getBufferStrategy();
/*  75 */      kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
				System.out.println("wtf");
/*  76 */     kfm.addKeyEventDispatcher(new KeyEventDispatcher()
/*     */     {
/*     */       public boolean dispatchKeyEvent(KeyEvent e)
/*     */       {
				System.out.println("wtf2");
/*  82 */         if (e.getID() == 401)
/*     */         {
/*  84 */           Main_Window.this.themodel.handleKeyBoardPressed(e);
/*     */         }
/*  86 */         if (e.getID() == 402)
/*     */         {
/*  88 */           Main_Window.this.themodel.handleKeyBoardReleased(e);
/*     */         }
/*     */ 
/*  92 */         e.consume();
/*  93 */         return true;
/*     */       }
/*     */     });
/*  99 */     this.screenwidth = this.myWindow.getWidth();
/* 100 */     this.screenheight = this.myWindow.getHeight();
/* 101 */     this.offsetx = ((this.screenwidth - this.resolution.x) / 2);
/* 102 */     this.offsety = ((this.screenheight - this.resolution.y) / 2);
/*     */   }
/*     */ 
/*     */   void theGame()
/*     */   {
/* 118 */     while (!this.themodel.getQuit()) { this.fpstimer = System.currentTimeMillis();
/*     */// 	System.out.println("wtf");
/* 122 */       this.themodel.UpdateGame();
/*     */ 
/* 124 */       Graphics g = this.strategy.getDrawGraphics();
/* 125 */       Graphics2D g2d = (Graphics2D)g;
/*     */ 
/* 128 */       g.setColor(Color.white);
/* 129 */       g.fillRect(0, 0, this.screenwidth, this.screenheight);
/* 130 */       this.themodel.drawGame(g2d, this.offsetx, this.offsety);
/* 131 */       g.setColor(Color.black);
/* 132 */       g.fillRect(0, 0, this.offsetx, this.screenheight);
/* 133 */       g.fillRect(this.screenwidth - this.offsetx, 0, this.offsetx, this.screenheight);
/* 134 */       g.fillRect(this.offsetx, 0, this.resolution.x, this.offsety);
/* 135 */       g.fillRect(this.offsetx, this.screenheight - this.offsety, this.resolution.x, this.offsety);
/* 136 */       this.strategy.show();
/* 137 */       g.dispose();
/*     */ 
/* 140 */       while (this.fpstimer + 15.0D > System.currentTimeMillis()); } this.gd.setFullScreenWindow(null);
/* 143 */     this.frame.dispose();
/* 144 */     this.myWindow.dispose();
/*     */   }
/*     */ }