Keep the same layout for the normal 4 and jam the two extras to the side.
I'm not opposed to the above, but I am worried that it takes too much extra space since it needs an additional button width horizontally and half a button height vertically.
What about instead of a grid
1 | Y | 2
---+---+---
A | | B
---+---+---
3 | X | 4
we move the extra buttons slightly outwards (it uses a bit more space like that, but just a bit), either like this:
+-1-+---+-2-+
| | Y | |
+---+---+---+
| A | | B |
+---+---+---+
| | X | |
+-3-+---+-4-+
or like this:
Code:
+---+---+---+
1 | Y | 2
+---+---+---+
| A | | B |
+---+---+---+
3 | X | 4
+---+---+---+
That way the extra space needed is limited to one axis (vertical in the former, horizontal in the latter), and you still get somewhat diagonal lines of 3 buttons.