Comments (14)
And this is on Windows, yes?
from mkxp.
This is on Windows yes.
I've managed a temporary fix after some tinkering, by including another call to Win32API:
GetKeyState=Win32API.new("user32", "GetKeyState", "I", "I")
GetKeyState.call(0)
This makes input work just fine it has just one very big side-effect.
It continues grabbing and updating keystrokes even when the application isn't active/minimized.
Do you have any plans of adding full-keyboard input to mkxp, perhaps?
from mkxp.
Do you have any plans of adding full-keyboard input to mkxp, perhaps?
Yes, see #70. I'm still thinking about the best way to write something generic that can cover as many use cases as possible. I will probably open a separate issue for it soon.
from mkxp.
I created an issue for general keyboard input: #73. As for your specific problem khkramer, it could be related to how SDL sets up its window and processes messages on Windows. Why do you need it to work so badly btw., I thought you were trying to port the code over to mkxp anyway?
from mkxp.
Well I had to have the chat functional to test a lot of things, and I didn't know if you were going to add full keyboard input or something that allows us to use those full keyboard input scripts, so my plan was originally to first fix it on windows and then look up if there are similar api calls on Linux.
I'm pretty sure it's how SDL set up its windows then, since I'm checking the thread id of the caller (so the game) and then checking the thread id of the foreground window, and then comparing them to see if the game has focus and is in the foreground. However even when it is the foreground window it returns another thread id for the window than the 'normal' thread id if that makes sense
from mkxp.
Added full keyboard support to mkxp, you can check my win32 wrapper for how to use it.
from mkxp.
Cool.
I'll try it out later today, and let you know how it worked.
from mkxp.
Closing this for now, reopen if you need to.
from mkxp.
Very very late response from me :)
It works like a charm, however it breaks mouseclicks for me.
I've found the cause as well, in Input.h, MouseLeft has scancode 0x38, while in the RMX-OS input script and your win32-wrapper the 'Up' key has scancode 0x38. So whenever I press the up key it thinks the left mouse is being clicked as well, while clicking the actual left mouse does nothing.
from mkxp.
Oh, I see, it's because you're overriding Input
functions so my wrapper ends up calling your modified code. The proper fix on the mkxp side is to just completely remove the mouse extensions from Input
and stash them into MKXP
(which I should have done from the start), but until that change has landed, the quick fix is to save an alias to the original update
function and call that in the win32 wrapper instead.
from mkxp.
Input.update isn't being called in the win32-wrapper??
from mkxp.
Oh sorry, brainfart. I meant press?
of course.
from mkxp.
I saved an alias like this
module Input
class << self
alias_method(:win32wrap_press?, :press?)
def press?(num)
win32wrap_press?(num)
end
end
end
And called that instead and it's not detecting arrow keys as mouse buttons anymore, however actual mouse clicks still aren't detected.
Edit: Tried another input script with which it does work. So this problem is pretty much fixed on my end.
from mkxp.
I'd still be interested into why Mouse input didn't work the first time, but oh well.
from mkxp.
Related Issues (20)
- Fluidsynth-related compilation error on Arch Linux HOT 2
- Search for mkxp.conf in more paths HOT 3
- Some (maybe) helpful font size stuff!
- High-level RPG Maker MV emulation support aka "mkmv" HOT 5
- Error "The RGSS script seems to be stuck and mkxp will now quit." HOT 6
- Fonts are completely broken HOT 1
- How compile? and another dunno HOT 2
- incorrect serialization of multi-dimensional tables if {y,z}size <= 1
- BGM should not be played before ME when calling me_play and bgm_play together
- Expect retrieved value to be the same as assigned value HOT 3
- Error 'Script 'fuyllscreen' line 14: NameError occureduninitialized constant Module::Win32API' HOT 2
- Video reproduction implementation missing. HOT 5
- Best Way to Detect if Running mkxp? HOT 1
- Does mkxp recognize multiple RTPs? HOT 2
- openReadEnumCB just gives up if a closely matching filename is found
- pathCache search keeps searching even after file is found
- Window content won't draw outside of a 640x480 region HOT 2
- Sound system initialization should not be compulsory
- Error With PKGConfig and CMake HOT 1
- Sudden crash : Script 'Zeus Map Effects' - line 85: No MethodError occured. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkxp.