Ranadip Was correct!!! His suggestion fixed the problem... But I got an error because $key needed to be [string]$key. The problem went away after that!!! You all have done me a great service!!!!!
$button.InputMapping = $key