On Sun, 11 Sep 2011 04:25:57 -0400 Youness Alaoui <kakar...@kakaroto.homelinux.net> said:
strings are easier to maintain (no header-from-hell to maintain with every possible key on every possible system defined as a number). and reality is you never know the #defined keysym until you press the key on the kbd and find out the event you actually get. what keysym is the "PgUp" key? Prior? KP_Prior? Next? Up? Page_Up? KP_Up? KP_Page_Up? ISO_Move_Line_Up? ISO_Fast_Cursor_Up? Pointer_Up? PreviousCandidate? ISO_Prev_Group? Prev_Virtual_Screen? ... hint.. it's probably not what u think it is. reality is that u'll be testing a real kbd to figure out what many keys produce via a real app (eg xev output or your apps own debugging). i spent years continually looking up the keysym def files... and it was always cumbersome and less work that just adding a printf in o a stringified version of the keysym. :) and strcmp efficiency? the day you have such a massive stream of key events to strcmp where it matters... let me know :) > Hi, > 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? > > Thank you, > KaKaRoTo > ------------------------------------------------------------------------------ > 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 > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2dcopy2 _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel