The blog of roncli blog
Houston, Texas, United States
CTG Music
Trax in Space Beta
Recent Posts
More on Textboxes
Making Textboxes Ain't Easy
Liquid War
#modarchive Story 2
Slow Going
Music Clean Up
Cent Settings Screenshot
Comparing Cherries to Pears
Monday, March 28, 2005
Sleep is Needed?
Posted: 3:43:00 PM 0 comments
Now playing: dfast - rauhaisa (3:05)

I can code VB in my sleep. C++ is a different story.

After pulling a 30 hour marathon Saturday/Sunday for no reason other than I wasn't tired, I woke up this morning (I think it was around 1:30 AM) and did stuff throughout the day. About 12 hours into being awake, I started playing with the textboxes again. I fixed some annoying bugs I was having with them, and then decided that I would start adding features. One of which is the ability to use the tab key to go between textboxes.

Well, it wasn't working, and I couldn't for the life of me figure out what was wrong. I went into the debugger to see what the key code was. It was coming back as a "9" as expected. Alright, that meant that it was likely the "9" didn't equal CSKEY_TAB. Right? I go and look, and CSKEY_TAB is defined to '\t'.

This is where the lack of sleep comes in. I thought, "Oh wait, \t is 20! It should be \i instead!!"

So I spent an hour trying to figure out 1) Why CSKEY_TAB wasn't '\i', and 2) Why tab worked in OTHER Crystal Space applications. After looking around for some documentation on keyboard events in Crystal Space and finding nothing, I decided to work up the nerve to ask on #crystalspace on IRC. The conversation went something like this.

roncli: Hmm. CSKEY_TAB is defined as '\t' (20), but when I hit tab, it's coming back with '\i' (9)... Is that normal?
res2k: roncli: \t should be 9
res2k: looks to me like you believe '\X' would resolve to the index of X in the alphabet, which is totally wrong

That's when the error in what I was doing sunk in, and when I decided to crawl into a little hole for a while I went back and studied what I apparantly didn't learn reading my C++ materials.

Labels: , , ,


Post a Comment