About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
invalid Kb.f() return value
Author Message
rndbit Offline
Member

Post: #1
invalid Kb.f() return value
This function returns odd values if no function key is pressed. Say i press KB_X key, then Kb.f() would return value 88, which is none of function keys. Shouldn't it return 0 in that case?
02-20-2011 04:41 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: invalid Kb.f() return value
Kb.f returns not KB_ but KF_
02-20-2011 05:08 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #3
RE: invalid Kb.f() return value
yes, i know, and returned value is invalid. at the moment i test validity of returned value like this:
Code:
KB_FUNC kpFunc = Kb.f();
    if(!Kb.funcName(kpFunc))
        kpFunc = NO_FUNC;
This is not the fastest way to do things i assume, so it would be nice that Kb.f() returned 0 in place of some odd not entirely random, but certainly invalid value smile
02-20-2011 05:38 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: invalid Kb.f() return value
for pressing 'x' Kb.f may return 'x' or 'X'
02-20-2011 05:42 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #5
RE: invalid Kb.f() return value
hmm i see. no docs describle this behavior. now it makes sense
02-20-2011 05:48 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: invalid Kb.f() return value
yes, there should be KF_X and similar KF for all other char keys, but I never added this
02-20-2011 06:56 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #7
RE: invalid Kb.f() return value
what is the difference between KB and KF then? They look same to me.
02-21-2011 09:35 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: invalid Kb.f() return value
kf will get called every few 0.x seconds sequentially when holding button
kb can be used to detect push, on state, release, double click only
02-21-2011 05:06 PM
Find all posts by this user Quote this message in a reply
Post Reply