On Sun, 11 Sep 2011 04:25:57 -0400 Youness Alaoui <kakar...@kakaroto.homelinux.net> wrote:
> While I'm working on adding keyboard support to ecore/ecore-evas for > the ps3 engine, I noticed that there is no enum for the various keys, > they are strings instead. I do not understand *why* this is done this > way... first of all, doing strcmp is less efficient than a int > comparison, secondly, it produces uglier code, and most importantly, > it's prone to errors.. what if I compare with "up" instead of "Up" ? > and I don't see any list of what the strings should be.. is it > "Enter" or "Return".. The ps3 SDK also can give me either the raw > code or the utf-8 of the key code, do I need to put a huge list > associating each key code with the keyname ecore expects or can I > just use the utf-8 character? Why do I need to change "(" into > "parenleft" and why do I need to check if it's "2" or "at" symbol > when the ps3 SDK itself transforms it correctly for me depending on > the chosen layout and LED states? Are you forcing every ecore_* > module to have a copy of some list to associate keys with the > expected keyname ? and every library user to have a big if/else to > check the keys entered? Anyone (raster?) knows of any good reason for > this design? Yes, I thought that was ugly as well. In my framebuffer project, I also noticed that I'm being passed a strdup of those fixed strings. Which forces me to do lots of strcmps with MORE fixed strings in a big if/else tree. Ewwwwww Lucky this project of mine only needs a small subset of the keyboard supported. If I remember rightly it's only the QWERTY layout as well. shudder -- A big old stinking pile of genius that no one wants coz there are too many silver coated monkeys in the world.
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Using storage to extend the benefits of virtualization and iSCSI Virtualization increases hardware utilization and delivers a new level of agility. Learn what those decisions are and how to modernize your storage and backup environments for virtualization. http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel