default namespace = "http://www.xmlmind.com/xmleditor/schema/quickrefcard"

start = quickrefcard-element

quickrefcard-element = element quickrefcard {
    section-element+
}

section-element = element section {
    title-element,
    note-element*,
    (item-element+ | (item-element*, section-element+))
}

title-element = element title { text }

note-element = element note {  
    para-element+
}

item-element = element item {
    attribute important { "important" }?,
    user-input,
    on-mac-element?,
    para-element
}

user-input = ((key-element|char-element)+ | mouse | dnd-drop-element)

on-mac-element = element on-mac {
    user-input? 
}

para-element = element para {
    text & literal-element* & emphasis-element* & gui-element*
}

literal-element = element literal { text }

emphasis-element = element emphasis { text }

gui-element = element gui { text }

dnd-drop-element = element dnd-drop {
    empty
}

mouse = element press-1 | press-2 | press-3 | 
                drag-1 | drag-2 | drag-3 |
                release-1 | release-2 | release-3 | 
                click-1 | click-2 | click-3 | 
                double-click-1 | double-click-2 | double-click-3 | 
                triple-click-1 | triple-click-2 | triple-click-3 |
                wheel {
    modifiers
}

modifiers = (attribute mod { "mod" } | attribute ctrl { "ctrl" })? &
             attribute shift { "shift" }? &
             attribute alt { "alt" }?

key-element = element key {
    modifiers &
    ("0" |
     "1" |
     "2" |
     "3" |
     "4" |
     "5" |
     "6" |
     "7" |
     "8" |
     "9" |
     "A" |
     "ACCEPT" |
     "ADD" |
     "AGAIN" |
     "ALL_CANDIDATES" |
     "ALPHANUMERIC" |
     "AMPERSAND" |
     "ASTERISK" |
     "AT" |
     "B" |
     "BACK_QUOTE" |
     "BACK_SLASH" |
     "BACK_SPACE" |
     "BRACELEFT" |
     "BRACERIGHT" |
     "C" |
     "CANCEL" |
     "CAPS_LOCK" |
     "CIRCUMFLEX" |
     "CLEAR" |
     "CLOSE_BRACKET" |
     "CODE_INPUT" |
     "COLON" |
     "COMMA" |
     "COMPOSE" |
     "CONVERT" |
     "COPY" |
     "CUT" |
     "D" |
     "DEAD_ABOVEDOT" |
     "DEAD_ABOVERING" |
     "DEAD_ACUTE" |
     "DEAD_BREVE" |
     "DEAD_CARON" |
     "DEAD_CEDILLA" |
     "DEAD_CIRCUMFLEX" |
     "DEAD_DIAERESIS" |
     "DEAD_DOUBLEACUTE" |
     "DEAD_GRAVE" |
     "DEAD_IOTA" |
     "DEAD_MACRON" |
     "DEAD_OGONEK" |
     "DEAD_SEMIVOICED_SOUND" |
     "DEAD_TILDE" |
     "DEAD_VOICED_SOUND" |
     "DECIMAL" |
     "DELETE" |
     "DIVIDE" |
     "DOLLAR" |
     "DOWN" |
     "E" |
     "END" |
     "ENTER" |
     "EQUALS" |
     "ESCAPE" |
     "EURO_SIGN" |
     "EXCLAMATION_MARK" |
     "F" |
     "F1" |
     "F10" |
     "F11" |
     "F12" |
     "F13" |
     "F14" |
     "F15" |
     "F16" |
     "F17" |
     "F18" |
     "F19" |
     "F2" |
     "F20" |
     "F21" |
     "F22" |
     "F23" |
     "F24" |
     "F3" |
     "F4" |
     "F5" |
     "F6" |
     "F7" |
     "F8" |
     "F9" |
     "FINAL" |
     "FIND" |
     "FULL_WIDTH" |
     "G" |
     "GREATER" |
     "H" |
     "HALF_WIDTH" |
     "HELP" |
     "HIRAGANA" |
     "HOME" |
     "I" |
     "INPUT_METHOD_ON_OFF" |
     "INSERT" |
     "INVERTED_EXCLAMATION_MARK" |
     "J" |
     "JAPANESE_HIRAGANA" |
     "JAPANESE_KATAKANA" |
     "JAPANESE_ROMAN" |
     "K" |
     "KANA" |
     "KANA_LOCK" |
     "KANJI" |
     "KATAKANA" |
     "KP_DOWN" |
     "KP_LEFT" |
     "KP_RIGHT" |
     "KP_UP" |
     "L" |
     "LEFT" |
     "LEFT_PARENTHESIS" |
     "LESS" |
     "M" |
     "MINUS" |
     "MODECHANGE" |
     "MULTIPLY" |
     "N" |
     "NONCONVERT" |
     "NUMBER_SIGN" |
     "NUMPAD0" |
     "NUMPAD1" |
     "NUMPAD2" |
     "NUMPAD3" |
     "NUMPAD4" |
     "NUMPAD5" |
     "NUMPAD6" |
     "NUMPAD7" |
     "NUMPAD8" |
     "NUMPAD9" |
     "NUM_LOCK" |
     "O" |
     "OPEN_BRACKET" |
     "P" |
     "PAGE_DOWN" |
     "PAGE_UP" |
     "PASTE" |
     "PAUSE" |
     "PERIOD" |
     "PLUS" |
     "PREVIOUS_CANDIDATE" |
     "PRINTSCREEN" |
     "PROPS" |
     "Q" |
     "QUOTE" |
     "QUOTEDBL" |
     "R" |
     "RIGHT" |
     "RIGHT_PARENTHESIS" |
     "ROMAN_CHARACTERS" |
     "S" |
     "SCROLL_LOCK" |
     "SEMICOLON" |
     "SEPARATOR" |
     "SLASH" |
     "SPACE" |
     "STOP" |
     "SUBTRACT" |
     "T" |
     "TAB" |
     "U" |
     "UNDERSCORE" |
     "UNDO" |
     "UP" |
     "V" |
     "W" |
     "X" |
     "Y" |
     "Z" )
}

char-element = element char {
    xsd:string { minLength="1" maxLength="1" }
}
