Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you tried logging the values of <code>eventChars</code> and <code>modifierFlags</code> using <code>NSLog</code>? Perhaps it's something other than what you expected it to be. If the log statement doesn't show up in your output, then this code is not running at all and you have a problem somewhere else.</p> <pre><code>NSLog(@"Chars: %@, modifier flags: 0x%x", eventChars, [theEvent modifierFlags]); </code></pre> <p>Some other things worth noting:</p> <ol> <li><code>isEqualTo:</code> is the AppleScript equality operator. It <em>should</em> work, but won't be as efficient because it goes through <code>compare:</code>. The proper method is either <code>isEqualToString:</code> or the more-generic <code>isEqual:</code>, either of which may do a straight equality comparison.</li> <li><p>The traditional set of movement keys in the QWERTY letter region is wsad, not wxad. This uses the inverted-T arrangement. You may also want to support the arrow keys, as many of us do have keyboards with their arrows in the inverted T arrangement.</p> <p>Furthermore, you should make these configurable by the user, and you should respond to <em>key codes</em> rather than letters because different layouts (French, Dvorak, etc.) will generate different letters. I have <a href="http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes" rel="nofollow noreferrer">a table of key codes, adapted from Inside Macintosh</a>, on my website. Use characters only for display purposes.</p></li> <li>Shouldn't it be “<code>fireBullet</code><em><code>From</code></em><code>Column:row:inDirection:</code>”? I don't know about you, but saying that the method fires a bullet <em>at</em> a cell tells me (and will tell you, after you haven't looked at the code for a year) that it fires the bullet <em>toward</em> that cell; replacing “At” with “From” avoids this moment of confusion.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload