I'm not sure what you are asking? Is this supposed to work from an
application? Or do you just want to assign certain keys to functions?
If you want to quickly view files, popup graphics, or see file info with
a single keystoke, I suggest you look into using midnight commander,
"mc". You can assign a "picture viewer" to certain file types, and they
will open up just by hitting enter on them. I use "quick image viewer"
with my mc, it's 39k and will just pop open any graphic using the gtk
toolkit. If you want to view the files, hit F3 and you can look at the file
internals, even in hex if you want.