Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (801)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
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 2045 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.

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 (353 views)
2019-09-04 15:33:17

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

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

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

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

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

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

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

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

nelsongames (4590 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

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 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‑
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!