PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

JoJoSIP question

hi,

I have managed to use Jojosip to create a customised keyboard. My problem is that I cant seem to identify the Backspace button.

what should I compare the return from GetKey with? is it something like TEXT("BS") ?? Thank you in advance


thanks
joe
I have not the code in front of me right now but what you should compare with is a numeric value. I'm pretty sure by looking at the "skinning table" that backspace is 8 (started counting from 0 at the top of the table).

I will double check this later today on my own computer (with the source code).
I am also at this point, and with no real examples, I am running out of ideas.
The SIP maps to the ASCII tables. From the table, the Backspace character is 0x08, so this is what you test for.

Something like this works fine:
Code:

// Hit test the SIP
if(CJoJoSIP::GetSingleton().GetKey(t, p) == JOJOSIPINFO_KEYPRESSED)
{
char i = 0;

while ( m_playerName[i] != 0 && i < MAX_NAMECHAR )
i++;

// const int MJ_BACKSPACE = 0x08
if ( i <= MAX_NAMECHAR && i > 0 && t == MJ_BACKSPACE )
{
CAutoCritSect acs( &m_cs );

m_playerName[i-1]=0;
}

else if ( i < MAX_NAMECHAR )
{
CAutoCritSect acs( &m_cs );

m_playerName[i] = t;
}
}


A good trick is to use your debugger and set a break point at the line where you call GetKey and set a watch on the character returned.
Now that the demo code is available, I was able to harness it and get the keyboard working. Thank you for everybody's help.