I am new to AI and trying to write some texts on the buttons of the keyboard in the attached image:

I would like to add few letters on the buttons with missing letters in such a way they look similar to letters on other buttons.

I tried using solutions like 3D rotation as described here and warp text technique explained here. But none of them helped me...could anyone please guide me...

This one's a super-quick one - so I didn't make it perfect but just close enough to demonstrate the concept.

First, after placing your image as a backdrop (put it on its own layer and lock that layer) with nothing selected you choose the Eyedropper Tool from the toolbar. Click the eyedropper onto one of your letterforms: once the colour shows it's picked up that tone, save a swatch and call it something like "key letters".

Using the basic Type Tool, type your chosen letter on a new layer, select our letter and apply your "key letter" colour swatch.

Go up to the menu above, and choose Object>Envelope Distort>Make with Mesh

Choose a 1 x 1 mesh to make your life easy, and use the white Direct Select Arrow to move the individual anchor points to basically match the perspective distortion of the key rectangle.

Move the anchor handles to make the sides of the mesh as straight-line as you can... once you've done one letter to your satisfaction, move a copy to the next key, double click on it and you can edit the letter and the envelope will be retained - so you're home free!

My quickie ended up looking like this:

Hope this helps.

• Thanks a lot for wonderful explanation. @Danielillo was a simple and straightforward but perspective view could not be obtained as it look awkward when two letters are there. Your solution was elegant and just produced what I wanted. Activating Direct Selection Tool (I learnt it is easy by shortcut A and then double click to activate) and making boundary straight was challenging. I learnt by adjusting handle coinciding with boundary makes side as straight.Thanks a lot. – user3792463 Mar 23 '19 at 1:44

On your text, make a 3D rotate from menu Effect → 3D → Rotate: