About Store Forum Documentation Contact



Post Reply 
get keyboard input
Author Message
1991mirec Offline
Member

Post: #1
get keyboard input
how can i get the keyboard pressed button??
i need something like:
Code:
KB_FUNC button_pressed;
button_pressed= Kb.f();

but with KB_BUTTON instead of KB_FUNC there isn t function like Kb.b(); i checked that but how can i get the character pressed.. and i don t need the char variable that is there but i need KB_BUTTON.

thank you in advance
04-08-2014 07:43 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #2
RE: get keyboard input
Code:
if(Kb.c())
{
    Gui.msgBox("Button", Kb.c());
}

Place it in update. Does it suit you?

P.S. It doesn't catch functional keys
(This post was last modified: 04-08-2014 07:51 PM by Houge.)
04-08-2014 07:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
1991mirec Offline
Member

Post: #3
RE: get keyboard input
as i said i don t need it as char variable but as KB_BUTTON.
that i knew before.. but if i want to use Kb.b(KB_BUTTON) where needs to be KB_BUTTON i can t use Kb.c();
(This post was last modified: 04-08-2014 07:54 PM by 1991mirec.)
04-08-2014 07:54 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #4
RE: get keyboard input
smile Now i get it.
It seems like KB_BUTTON values are not taken from ascii char list...
04-08-2014 08:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
1991mirec Offline
Member

Post: #5
RE: get keyboard input
yeah that i figured too .. so i have no idea how i can get the button that i pushed in certain frame... if it is even possible.. all i can do is get a character with kb.c and put it to the function where i compare it with each one of the buttons and if it would be true then assaign that button to what i want.. is that all i can do?? that doesn t sound right...
04-08-2014 08:09 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #6
RE: get keyboard input
Or you can create your own letters map...
Hope Greg tells us what to do.
(This post was last modified: 04-08-2014 08:10 PM by Houge.)
04-08-2014 08:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #7
RE: get keyboard input
For more information about the KB_BUTTON numbering, see http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html

There doesn't seem to be an easy way to convert the numbering. What is the reason for needing the scan code? Kb.b(Kb.c()) would be redundant code, if it worked.
04-09-2014 03:29 AM
Find all posts by this user Quote this message in a reply
1991mirec Offline
Member

Post: #8
RE: get keyboard input
well and what if you want to make controls settings and you want to have a button there, which you click and it will pop up message please enter any key and when you enter it i need that key to change my preset key to it so player can use it..
so for example i have
KB_BUTTON kb_right ;
kb_right = KB_D and everywhere where i would use KB_D i write kb_right instead right now i need to figure how i can change kb_right to something else in game. and it should be the whatever button user push when he is asked to do so...
04-09-2014 02:08 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #9
RE: get keyboard input
REP(256)if(Kb.bp(KB_BUTTON(i))
04-09-2014 08:56 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #10
RE: get keyboard input
(04-09-2014 08:56 PM)Esenthel Wrote:  REP(256)if(Kb.bp(KB_BUTTON(i))

Rather hardcore solution smile
04-11-2014 12:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
1991mirec Offline
Member

Post: #11
RE: get keyboard input
but it works and seemes simple to me.. thank you just tryied it...
04-11-2014 01:00 PM
Find all posts by this user Quote this message in a reply
Post Reply