Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -

Post new topic Reply to topic  [ 4 posts ] 
  Wed Oct 12, 2011 11:09 pm
User avatar

Location: São Paulo, Brazil
Hello, on Thursday(October 11, 2011) I wanted to practice a little more of using ruby variables on C, so I've done this Input System, it's made of four scripts:
  • Simple Input - A Input class that uses C++ to get all the keys pressed, mouse position, and some joystick buttons.
  • Virtual-Key Codes - A conversion of Microsoft Virtual Key List for Ruby.
  • Check Keys - A function that converts one key pressed into a char. (if needed, I convert it to C too)
  • Window_Edit - A Window to input some information, it has: a cursor, functions for the keys home, end, delete, left, right, and ctr+v if you have Aleworks library(this last function wasn't tested yet).

This Input is an Add-On for Enterbrain's Input, it doesn't remove or substitute any Enterbrain's methods, only add news methods.

Why should you use this?: Because it is fast and gets all the needed variables in only one Win32API command.

Scripts (in English):
Simple Input
Expand to see the code.

Virtual-Key Codes
Expand to see the code.

Check Keys
Expand to see the code.

Expand to see the code.

DLL Source:
Expand to see the code.

Demo (in Portuguese):
Download using DROPBOX.COM

Compiled DLL included in Demo. Not tested yet on RMVX.
As you seen this is a simple and common script, that's why I'll only makes update when it's necessary; anyway thanks for the interesting on it. :biggrin:

Top Top

  Thu Oct 13, 2011 3:56 am
BEWARE: Glitchfinder's sense of humor sucks.
User avatar

Party Mascot

Location: Approximately 93 million miles from Sol.
While I applaud the work that went into this, I do have a complaint about it as well. This is primarily an English speaking forum, with many members in both the United States and Great Britain. The settings you have for the key checks are not the same as what these two groups would expect. For example, I'll list the differences between a USA 101 keyboard and what you have there.

The first one I noticed was your OEM_7 key. The unshifted (effectively, lowercase) character was "'", which is correct for this 101 keyboard. However, the shifted character was "\", which is another key entirely for us. (For locations on the keyboard, I believe OEM_7 is directly to the left of the return key, while the key that 101 keyboards use for "\" is OEM_5, which is directly above the return key, and features "\" as the unshifted character and "|" as the shifted character. The OEM_7 key features '"' as the shifted character for users of a USA 101 keyboard) The next thing I noted was the shifted character for KEY_6, which was "¨" for you, but is actually "^" for us. Next up, is the fact that you did not feature shifted characters for OEM_4, OEM_6, or OEM_5, ("{", "}", and "|", respectively), and that you failed to include OEM_2 ("/" unshifted, "?" shifted), OEM_3 ("`" unshifted, "~" shifted, although the shifted value for standard UK keyboards is actually different), OEM_PLUS ("=" unshifted, "+" shifted), OEM_COMMA ("," unshifted, "<" shifted), OEM_MINUS ("-" unshifted, "_" shifted), or OEM_PERIOD ("." unshifted, ">" shifted).

Now, I'm not saying this to be mean, rude, or anything like that. In the case of the missing keys I listed, I'm pointing them out because I would find it difficult to perform some input tasks without them, even in a game. And, even with a limited input system like many games offer for naming characters, you typically see several of those missing keys as available characters, especially the "-" and "_" characters. I'm also pointing out the differences because, as I said, this is a primarily English forum, and the format you have is not a primarily English format, or at the least, not a particularly common one here.

Now, before you take this the wrong way, I've gone through this with my own input script. I still have transcripts of conversations with BlueScope, a resident scripter who lives in Germany and uses a German format keyboard. My final conclusion with those conversations was that either I could either perfectly simulate a single keyboard, or I could do my best to simulate all keyboards by using an alternative method. I ended up choosing the alternative method, which was using native Windows calls to convert keycodes to their unicode representation according to the currently set system keyboard. And even then, I still had issues with dead keys (which are used in certain languages for things like adding accents to certain characters) and I also had issues where it could not properly read input from any keyboard format that used multiple keystrokes to define a single character. (Like Kana input, for example)

Anyway, that's about all I can say about it, aside from the fact that this appears to only read currently pressed keys when you check, which is terribly limited compared to most input systems I have seen for RMXP and RMVX. As it is, take what I said with a grain of salt, since I've moved on from RM* scripting and currently do most of my programming in C, C++, Java, and PHP, depending on what's currently needed.

Edit: One more thing that I would like to mention. You can actually simulate input from keyboards you don't own by setting the system keyboard to something else using the control panel, and then bringing up the On-Screen Keyboard, which can be found in the accessibility menu (under accessories) in your start menu.


Just call me Glitch.

Top Top

    Drago del Fato
  Thu Oct 13, 2011 3:01 pm
Dark Slayer
User avatar

L1 Slime

Location: Somewhere with a heater on...
Sure this is a forum with generally English population of people, and it is true that those keys are missing, but UNLESS you are making an online game which is the only kind of game where I would find those keys actually necessary, they are not actually needed. If I had to guess I think Pedro wanted to do a simple input system to allow people to make custom name input scripts or something like that.

In the end it all boils down to whether people are gonna use it or not. And as I said, this script is ok, without those missing keys, but not for online games or something that actually requires you to input those characters. :/

RAGE - A 2D Game Engine with Ruby scripting!. 0.0.3 - beta out!
Check it out here! https://github.com/ArekX/RAGE#releases

Visit my little scripts corner here. :)

Top Top

  Sun Oct 16, 2011 10:09 pm
The Third Man
User avatar

Location: Germany
No, you're not quite getting the point of what Glitch was trying to say. For me, several remotely important characters such as -, _, + and whatnot were non-functional with his initial version. Now, you might of course say they're not needed, but I think Glitchs point is (if not it's still mine) that if you make an input script, don't make one that supports only 60% of the keyboards out there, and everyone else "better not use those keys". I mean, if those special keys are only needed for special games, than I guess normal games only need normal keys. Well, normal keys are supported by default...


If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!

Top Top
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

Who is online

Users browsing this forum: No users and 12 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group