Detect Input type by checking if ANY key on keyboardd/joypad is pressed

is there a way to dynamically change the image of a button showing which key to press based on input type (keyboard & mouse | controller), so that when a controller is used, the button shows the A button (say) and when either the mouse or keyboard is used it swaps to the keyboard button instead?

var img1:Texture;//-----drag and drop a texture in the inspector here
var img2:Texture;//-----drag and drop a texture in the inspector here
var tex:Texture;
tex=img1;

function OnGUI(){
GUI.DrawTexture(Rect(Screen.width0.2,Screen.width0.2,Screen.width0.2,Screen.width0.2), tex);
}

function Update (){
if(Input.GetKeyDown(“a”)) {tex=img1;}
if(Input.GetKeyDown(“b”)) {tex=img2;}
}