Tuesday, October 6, 2009

An Interesting Discovery With Linux

While this will probably be well known to those familiar with Linux, I made an unexpected discovery while I was figuring out the key codes for the Linux platform for assignment 1. I am not sure if it was because of the shell I was using or the OS itself, as I was using PuTTY to connect with the matrix servers and didn't test any other methods. But I noticed that when I used the restore buttons on the PuTTY window (the small window button and the maximize window button) that the keycode.c program picked up 2 key strokes, much like the function keys in windows. The value returned was -1, so the program itself didn't know what it was looking at, but something was definitely passed through as a key stroke. This may or may not cause problems for our programs, but it definitely holds potential for the text editors projects we will be making later this semester.

It is possible someone may have already blogged about this, or it may even be in the instructions, but it caught me by surprise so I figured I might as well post it here.

2 comments:

  1. Good thing to note, question is; did it had any conflict with any known keys? if it didn't, in the program, if we simply ignore the unidentified keys, this should not cause any problem...

    ReplyDelete
  2. I am assuming this would be the terminal RESIZE keycode, which should have no conflict with known keys.
    This is defined as:
    #define KEY_RESIZE 0632 /* Terminal resize event */

    and would be very useful to monitor to redraw on resize events.

    ReplyDelete