I toyed with the idea, but the UI itself doesn't directly support key detection.
If there is a merchant window that always detected which button was visible (for when you try to buy a stack or single item) it might be possible though. Would be a tricky workaround
From my experience though, once you're not in a transaction, that window doesn't update. I can investigate further.