Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (799)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (865)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Input dies after a variable yet short amount of time  (Read 2005 times)
0 Members and 1 Guest are viewing this topic.
Offline Archive
« Posted 2016-11-26 05:51:13 »

Hello, there's this issue that comes up every once in a while (im talking many months in between each case) while I'm programming in java.

I run my program (which uses input, eg. keyboard and mouse), and everything runs fine but after x amount of time, keyboard input completely dies. The mouse still works, but the keyboard is dead. I didn't change my code, it's all identical to the way it was before when it worked, but for some reason, keyboard input just dies.

My physical keyboard isnt the problem because if it was, the mouse would be dead too since the mouse is plugged into the keyboard.


Oh yeah, im using eclispe by the way.

ALSO restarting the computer doesnt fix it

Offline Archive
« Reply #1 - Posted 2016-11-26 23:47:00 »

Ah it appears, after hours of debugging and research, that it is an issue with OS X Sierra.

It was (thankfully) addressed by the almighty David Brackeen on his github for his game called "Scared" in which he has made a workaround.
https://github.com/brackeen/Scared/blob/master/src/main/java/com/brackeen/app/App.java

If you dont want to click the link and scroll down to read the reason why it occurs, here you go

"
                // macOS Sierra prevents key input after holding certain keys (like 'e' or 'n')
                // because of a native input method popup that isn't working with Java correctly.
                //
                // This will still fail is some scenarios, like when pressing a digit after
                // holding 'e'. The digit will not have a keypress event.
                //
                // Tested on macOS 10.12.0 and Java 8 versions b76 - b101.
                // (This may also be happening on older versions of macOS if the
                // ApplePressAndHoldEnabled option is set to true - untested at the moment.)
                //
                // This workaround keeps key input working by allowing the popup to appear,
                // but places it offscreen.
                //
                // Note, input methods are enabled by default.
"
-David Brackeen

Offline Void_Massive

Junior Devvie


Medals: 2



« Reply #2 - Posted 2016-11-27 00:08:06 »

Nice, thanks for following through with an update.

At first I thought it had something to do with not de-allocating resource properly -- or something.
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (189 views)
2019-09-04 15:33:17

hadezbladez (4876 views)
2018-11-16 13:46:03

hadezbladez (1791 views)
2018-11-16 13:41:33

hadezbladez (5148 views)
2018-11-16 13:35:35

hadezbladez (1018 views)
2018-11-16 13:32:03

EgonOlsen (4377 views)
2018-06-10 19:43:48

EgonOlsen (5220 views)
2018-06-10 19:43:44

EgonOlsen (2949 views)
2018-06-10 19:43:20

DesertCoockie (3868 views)
2018-05-13 18:23:11

nelsongames (4294 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!