Blog | Tom Ward
It’s been awhile since I’ve done any development on NUKE, so when the other day
I was asked to put together a simple plugin on OSX, I thought it would be a good
time to try and create a simple XCode project to do my development in.
Sometimes it’s really useful to be able to encrypt a file locally, and although
there’s lots of pieces of software that can do this for you, I much prefer to
just do it myself. Using Terminal’s “openssl” command, it’s really really simple
to encrypt a file well enough for snoops to not be able to read.
A while back I was porting an application to Qt 4.8 on Windows and, due to the
fact the program couldn’t deal with varying DPI settings, I had to make sure Qt
didn’t call the “SetProcessDPIAware()” function. The simple way to do this
would be to simply recompile Qt to remove this offending line, but as we wanted
to share the exact same library with other products, I didn’t have that
luxury.
Because I’ve had to install Ubuntu a lot recently, and I always forget how to do
this.
Basically by default Ubuntu binds ALT+LMB to moving windows. This is incredibly
frustrating for nearly every 3D application, as this is usually the way to
rotate a camera, so most people disable this shortcut.
The simplest way I’ve found is to run this:
gconftool-2 --set /apps/metacity/general/mouse_button_modifier --type string '<super>'
which moves the key to the “Super” key (on a Windows keyboard this is the window
key, on mac the CMD key).
And that’s it! if you don’t have gconftool-2 installed (I think it comes with
Ubuntu by default, if not just install through apt-get)
I actually began this post well over a year ago, as I remember struggling to
work out how to read keyboard input in X. Anyway, I thought I’d finally finish
it off for posterity’s sake :)
I recently had to implement some API calls in Linux to be able to return what
keys were currently being pressed. As I was using Qt for the UI layer (which, by
the way, is now my favourite UI framework!) I was hoping there would be some
platform-agnostic call I could make. However (and kinda rightfully so) Qt
doesn’t expose a way to do this, as it’s assumed you should just do things based
on events.
After a few hours googling and scratching my head, I realised this wasn’t going
to be as simple as I imagined, as the documentation for anything X based seems
incessantly complex. Anyway, here’s how I did it!