PDA

View Full Version : Where are EventObject constants?



digerata
12 Jan 2010, 7:57 AM
In Ext, there are public constants on the EventObject for keys like Space, Control, Escape, etc.

In Ext Core, these aren't present anywhere.

Was this just overlooked?

Animal
12 Jan 2010, 8:04 AM
No, they are not included. The definitions are in the "-more" file which is built into the full Ext library.

digerata
12 Jan 2010, 8:14 AM
That seems petty that they wouldn't be included. This isn't some piece of complex code. It's common definitions that everyone who checks the keyboard needs.

I'm getting more and more disheartened by Ext every day.

edspencer
12 Jan 2010, 2:26 PM
That seems petty that they wouldn't be included. This isn't some piece of complex code. It's common definitions that everyone who checks the keyboard needs.

In Ext.Core, file size is a very high priority. There are a large number of constants defining the key codes which add to the file size for everyone - whether they use them or not.

We made the call that in the typical case the keycodes wouldn't be used and would therefore probably be sat around taking up space while adding no value.

There's nothing stopping you from defining them yourself after Ext Core is included - it's a one-time hassle but should be straightforward.