code: private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke) {
  		for (int i = 0; i < 3; i++) {
  			InputMap inputMap = component.getInputMap(i);
  			if (inputMap != null) {
  				Object key = inputMap.get(keyStroke);
  				if (key != null) {
  					return key;
  				}
  			}
  		}
  		return null;
  	}
docs: /*
  Search the 3 InputMaps to find the KeyStroke binding.
  1. WHEN_IN_FOCUSED_WINDOW,
  2. WHEN_FOCUSED,
  3. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT