function mk_key, input, ss
;
;+
;NAME:
;	mk_key
;PURPOSE:
;	Use the routine WMKKEY to construct a search key
;	WMKKEY uses widgets
;OPTIONAL INPUT:
;	input	- The structure to be searched.  For example,
;		  roadmap, index, or observing log.
;OPTIONAL OUTPUT:
;	ss	- A vector of the dataset# where the key matches
;		  "input".  It is only returned if "input" is passed
;		  to the routine.  If the user has made many keys
;		  while in WMKKEY, the "ss" result is only for the first
;		  key.
;OUTPUT:
;	Returns the string key
;HISTORY:
;	Written 6-Mar-92 by M.Morrison
;-
;
common wmkkey_blk, key
xmanager,'wmkkey',wmkkey()
;
if ((n_elements(input) ne 0) and (key ne '')) then begin
    ss = keysea(key(0), input)
    n = 0
    if (ss(0) ne -1) then n = n_elements(ss)
    ;
    print, n, ' datasets selected out of ', strtrim(n_elements(input),2)
    if (n eq 0) then print, string(7b)
end
;
return, key
end
