Showing posts from January, 2009

eRCP/eSWT: Windows CE and Win32 (XP): Different Keyboard Event Handling

When developing GUIs with Swing in Java I often swear about event handling, because it sometimes slightly differs from what the underlying platform would do. However when using SWT/eSWT and getting the native behaviors there are also gotchas waiting... In our Eclipse Embedded Rich Client Platform ( eRCP ) based mobile application we want to allow keyboard as well as touch-screen access. In order to do so we attach a KeyListener to the buttons that handle the assigned shortcut bindings in addition to a SelectionListener to respond to clicks. Another feature request called for the possibility to trigger a button by moving the focus to it with the keyboard and then hitting enter. During development we usually work with the eSWT implementation for Win32. Because by default pressing enter does not do anything on a button, we add another KeyListener to respond to the return key. This usually works flawlessly. However on the mobile device we had trouble with button actions being trigger

Prefer plain-text message display in Apple Mail

If a received mail contains a plain-text part I prefer Mail to display that instead of the often more “stylish” HTML or Rich-Text parts. While this cannot be configured via the GUI, it can be from the command line. This is a reminder post for myself and anyone who might be interested. Turn on: defaults write PreferPlainText -bool TRUE Turn off: defaults delete PreferPlainText should be closed while you do this. Technorati Tags: apple , mac os x , mail , software , mac

Windows CE 5 Batch File Caveats

If you find yourself in the unlucky position to have to write some batch files for the Windows CE5 version of cmd.exe (called Pocket CMD v 5.0) you might be interested in these peculiarities I stumbled across today: IF EXIST foldername GOTO label This will not tell you for real if a folder called "foldername" exists and jump to "label" if it does. Instead, this will always fail and never jump to the designated target label. You can try this yourself with IF NOT EXIST \WINDOWS ECHO "I have no OS" If this output were true, I'd wonder where the Pocket CMD that had issued the command came from. You need to check for a file contained in that folder with IF EXISTS , which will work fine. If you do not know a file name to check for - for example if you want to check if a removable storage card is inserted, you can check for the "nul" file which will always exist on a FAT formatted drive, according to Microsoft Knowledge Base Entry #65994

Launch Mac application / AppleScript by keyboard

In the comments to my recent post about full keyboard access to Mac OS X GUI controls “christian” asks about a way to open a new Finder window regardless of the front application. I understand his need, on Windows you just hit Windows+E anywhere and get a new Explorer window. So far I have worked around this when I needed a Finder window by first hitting F19 which I bound to Exposé’s Show Desktop option and then clicking on the desktop. This enabled the finder and allows the Cmd-N hotkey to work. However being able to just bring up a new Finder window from anywhere would of course be preferable. I first tried through the keyboard system preferences, however even though you can bind new keyboard shortcuts to any menu item by name. Because the application you target usually needs to focused this would not be of much help. There is a “Any application” setting, but this seems to work for a few people if any. I have not managed to get it right. In Apple’s AppleScript documentation t

Migrate VM from VirtualBox to VMware Fusion

For some time I have been using VirtualBox to run the few Windows applications I still need. While being generally very usable there were still some issues with networking, sharing folders and sometimes the VM would crash when shutting down the guest OS. Yesterday I decided to give VMware Fusion a chance. I downloaded and installed the trial version. Because I did not want to reinstall Vista and go through the whole update story again I looked for a way to reuse the existing VirtualBox VM. Unfortunately VMware cannot open the VDI files directly. There are some How-To’s on the web which usually include some trickery with Linux or at least involve several steps, but all those seemed a little too much hassle for me and I kept looking for an easier way. Turns out, VMware themselves offer the solution for free: Fusion’s main menu bar includes a “Migrate your PC…” option that will just open browser and take you to . There y

Mac OS X – Full Keyboard Control

As a long time Windows user I still have some trouble finding my way around Mac OS X Leopard without resorting to the mouse all the time. I am a “keyboard person” and like to keep my hands right before me instead of constantly reaching for the mouse. When I started to use Mac OS I believed it would simply be a matter of practice and learning some new key combinations until I could work as mouselessly as before. Since August I have gotten much more fluent with the keyboard alone, but something that bothered me ever since was that not every button, tab, slider etc. could be focused with the TAB key or activated using some mnemonic – as is normal in virtually every Windows application, especially Microsoft’s own ones. On the Mac the focus would only jump between various text controls and not to buttons and the like. I started to believe that the Apple idea of “keep things simple and define a default that’s good for 90% of the people” without a chance for the remaining 10% to have th