Q: why is my custom control event not registered? I'm using a custom control in my app, with some properties and behavior. But when I want to fire an event, it doesn't work! Instead it says: "firePress is not a function".
Here is some sample code of my control:
sap.ui.core.Control.extend("mycontrols.CustomContent", {
    metadata: {

        properties: { 

            enabled: {type: "boolean", defaultValue: true},
            title: {type: "string", defaultValue: null},
            icon: {type: "sap.ui.core.URI", defaultValue: null},                
            size: {type: "sap.ui.core.CSSSize", defaultValue: "200px"}
        }
    },
    // control events
    events: {
        press: {enablePreventDefault : true}
    },

    // browser Events:  
    ontap: function (oEvent) {
        this.firePress({}); // -> not working!
    }

});

I've read that when you declare an event, the UI5 framework will automatically generate methods for registering (attachYourEvent), de-registering (detachYourEvent) and firing events (fireYourEvent): see SAPUI5 custom pseudo-event
What am I missing ?

A: Actually, it's because "events" must be a member of "metadata"!
So the correct code would be:
sap.ui.core.Control.extend("mycontrols.CustomContent", {
    metadata: {

        properties: { 

            // etc...
        },

        events: {
           press: {}
        }
    },

    // browser Events:  
    ontap: function (oEvent) {
        this.firePress({}); // -> will work now!
    }

});

