简体   繁体   中英

jsfml, poolEvents() method

I recently started project in java using the JSFML library. My code fragment looks like this:

Iterable<Event> events;
events = mRenderWindow.pollEvents();
mKeyboardListener.handleEvents(events);
mMouseListener.handleEvents(events);

My problem is, when I firstly use KeyboardListener , then MouseListener is not working and vice versa. Can someone explain this behaviour? I searched for some info and there is not enough explanation.

如果希望多次迭代它们,你应该复制这些事件,这是因为jsfml指定了一个自定义迭代器。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM