summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/button.c
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-02-16 17:34:48 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-02-16 17:34:48 +0000
commitf615fb43d5321a37b8ba7f767c59d6bc0fe6e9b5 (patch)
tree94c1db09544b398ad15773c9923331a02e6cd92f /uisimulator/sdl/button.c
parent13035a48afe35340828cccad2a2b0569434f155d (diff)
downloadrockbox-f615fb43d5321a37b8ba7f767c59d6bc0fe6e9b5.tar.gz
rockbox-f615fb43d5321a37b8ba7f767c59d6bc0fe6e9b5.zip
Turn the simulator background into a clickable area. i.e. you click on the play button to press play. It also maps mouse scrollwheel events to rockbox scrollwheel events. This facilitates testing because you don't have to move your hand between the mouse and keyboard.
Author: Fred Bauer Flyspray: FS#11008 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24696 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/sdl/button.c')
-rw-r--r--uisimulator/sdl/button.c449
1 files changed, 449 insertions, 0 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index a102925ed2..52646220e7 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -1092,6 +1092,9 @@ void button_event(int key, bool pressed)
1092 case SDLK_DOWN: 1092 case SDLK_DOWN:
1093 new_btn = BUTTON_DOWN; 1093 new_btn = BUTTON_DOWN;
1094 break; 1094 break;
1095 case SDLK_KP1:
1096 new_btn = BUTTON_MENU;
1097 break;
1095 case SDLK_KP5: 1098 case SDLK_KP5:
1096 case SDLK_SPACE: 1099 case SDLK_SPACE:
1097 new_btn = BUTTON_PLAY; 1100 new_btn = BUTTON_PLAY;
@@ -1392,3 +1395,449 @@ void button_init_sdl(void)
1392#endif 1395#endif
1393} 1396}
1394 1397
1398/* Button maps: simulated key, x, y, radius, name */
1399/* Run sim with --mapping to get coordinates */
1400/* or --debugbuttons to check */
1401/* The First matching button is returned */
1402
1403#ifdef SANSA_FUZE
1404struct button_map bm[] = {
1405 { SDLK_KP8, 70, 265, 35, "Scroll Back" },
1406 { SDLK_KP9, 141, 255, 31, "Play" },
1407 { SDLK_KP_MULTIPLY, 228, 267, 18, "Home" },
1408 { SDLK_LEFT, 69, 329, 31, "Left" },
1409 { SDLK_SPACE, 141, 330, 20, "Select" },
1410 { SDLK_RIGHT, 214, 331, 23, "Right" },
1411 { SDLK_KP3, 142, 406, 30, "Menu" },
1412 { SDLK_DOWN, 221, 384, 24, "Scroll Fwd" },
1413 { SDLK_KP_MINUS, 270, 299, 25, "Power" },
1414 { SDLK_h, 269, 358, 26, "Hold" },
1415 { 0, 0, 0, 0, "None" }
1416};
1417#elif defined (SANSA_CLIP)
1418struct button_map bm[] = {
1419 { SDLK_KP_MULTIPLY, 165, 158, 17, "Home" },
1420 { SDLK_KP5, 102, 230, 29, "Select" },
1421 { SDLK_KP8, 100, 179, 25, "Play" },
1422 { SDLK_KP4, 53, 231, 21, "Left" },
1423 { SDLK_KP6, 147, 232, 19, "Right" },
1424 { SDLK_KP2, 105, 275, 22, "Menu" },
1425 { 0, 0, 0, 0, "None" }
1426};
1427#elif defined (SANSA_C200) || defined(SANSA_C200V2)
1428struct button_map bm[] = {
1429
1430 { SDLK_KP7, 84, 7, 21, "Vol Down" },
1431 { SDLK_KP9, 158, 7, 20, "Vol Up" },
1432 { SDLK_KP1, 173, 130, 27, "Record" },
1433 { SDLK_KP5, 277, 75, 21, "Select" },
1434 { SDLK_KP4, 233, 75, 24, "Left" },
1435 { SDLK_KP6, 313, 74, 18, "Right" },
1436 { SDLK_KP8, 276, 34, 15, "Play" },
1437 { SDLK_KP2, 277, 119, 17, "Down" },
1438 { SDLK_KP3, 314, 113, 19, "Menu" },
1439 { 0, 0, 0, 0, "None" }
1440};
1441#elif defined (SANSA_E200V2) || defined(SANSA_E200)
1442struct button_map bm[] = {
1443 { SDLK_KP7, 5, 92, 18, "Record" },
1444 { SDLK_KP9, 128, 295, 43, "Play" },
1445 { SDLK_KP4, 42, 380, 33, "Left" },
1446 { SDLK_KP5, 129, 378, 36, "Select" },
1447 { SDLK_KP6, 218, 383, 30, "Right" },
1448 { SDLK_KP3, 129, 461, 29, "Down" },
1449 { SDLK_KP1, 55, 464, 20, "Menu" },
1450 { SDLK_KP8, 92, 338, 17, "Scroll Back" },
1451 { SDLK_KP2, 167, 342, 17, "Scroll Fwd" },
1452 { 0, 0, 0, 0, "None" }
1453};
1454#elif defined (SANSA_M200V4)
1455struct button_map bm[] = {
1456 { SDLK_KP_PLUS, 54, 14, 16, "Power" },
1457 { SDLK_KP7, 96, 13, 12, "Vol Down" },
1458 { SDLK_KP9, 139, 14, 14, "Vol Up" },
1459 { SDLK_KP5, 260, 82, 20, "Select" },
1460 { SDLK_KP8, 258, 35, 30, "Play" },
1461 { SDLK_KP4, 214, 84, 25, "Left" },
1462 { SDLK_KP6, 300, 83, 24, "Right" },
1463 { SDLK_KP2, 262, 125, 28, "Repeat" },
1464 { SDLK_h, 113, 151, 21, "Hold" },
1465 { 0, 0, 0, 0, "None" }
1466};
1467#elif defined (IPOD_VIDEO)
1468struct button_map bm[] = {
1469 { SDLK_KP_PERIOD, 174, 350, 35, "Menu" },
1470 { SDLK_KP8, 110, 380, 33, "Scroll Back" },
1471 { SDLK_KP2, 234, 377, 34, "Scroll Fwd" },
1472 { SDLK_KP4, 78, 438, 47, "Left" },
1473 { SDLK_KP5, 172, 435, 43, "Select" },
1474 { SDLK_KP6, 262, 438, 52, "Right" },
1475 { SDLK_KP_PLUS, 172, 519, 43, "Play" },
1476 { 0, 0, 0 , 0, "None" }
1477};
1478#elif defined (IPOD_MINI) || defined(IPOD_MINI2G)
1479struct button_map bm[] = {
1480 { SDLK_KP5, 92, 267, 29, "Select" },
1481 { SDLK_KP4, 31, 263, 37, "Left" },
1482 { SDLK_KP6, 150, 268, 33, "Right" },
1483 { SDLK_KP_PERIOD, 93, 209, 30, "Menu" },
1484 { SDLK_KP_PLUS, 93, 324, 25, "Play" },
1485 { SDLK_KP8, 53, 220, 29, "Scroll Back" },
1486 { SDLK_KP2, 134, 219, 31, "Scroll Fwd" },
1487 { 0, 0, 0 , 0, "None" }
1488};
1489#elif defined (IPOD_3G)
1490struct button_map bm[] = {
1491 { SDLK_KP5, 108, 296, 26, "Select" },
1492 { SDLK_KP8, 70, 255, 26, "Scroll Back" },
1493 { SDLK_KP2, 149, 256, 28, "Scroll Fwd" },
1494 { SDLK_KP4, 27, 186, 22, "Left" },
1495 { SDLK_KP_PERIOD, 82, 185, 22, "Menu" },
1496 { SDLK_KP_PERIOD, 133, 185, 21, "Play" },
1497 { SDLK_KP6, 189, 188, 21, "Right" },
1498 { 0, 0, 0 , 0, "None" }
1499};
1500#elif defined (IPOD_4G)
1501struct button_map bm[] = {
1502 { SDLK_KP5, 96, 269, 27, "Select" },
1503 { SDLK_KP4, 39, 267, 30, "Left" },
1504 { SDLK_KP6, 153, 270, 27, "Right" },
1505 { SDLK_KP_PERIOD, 96, 219, 30, "Menu" },
1506 { SDLK_KP_PLUS, 95, 326, 27, "Play" },
1507 { SDLK_KP8, 57, 233, 29, "Scroll Back" },
1508 { SDLK_KP2, 132, 226, 29, "Scroll Fwd" },
1509 { 0, 0, 0 , 0, "None" }
1510};
1511#elif defined (IPOD_COLOR)
1512struct button_map bm[] = {
1513 { SDLK_KP5, 128, 362, 35, "Select" },
1514 { SDLK_KP4, 55, 358, 38, "Left" },
1515 { SDLK_KP6, 203, 359, 39, "Right" },
1516 { SDLK_KP_PERIOD, 128, 282, 34, "Menu" },
1517 { SDLK_KP_PLUS, 129, 439, 41, "Play" },
1518 { SDLK_KP8, 76, 309, 34, "Scroll Back" },
1519 { SDLK_KP2, 182, 311, 45, "Scroll Fwd" },
1520 { 0, 0, 0 , 0, "None" }
1521};
1522#elif defined (IPOD_1G2G)
1523struct button_map bm[] = {
1524 { SDLK_KP5, 112, 265, 31, "Select" },
1525 { SDLK_KP8, 74, 224, 28, "Scroll Back" },
1526 { SDLK_KP2, 146, 228, 28, "Scroll Fwd" },
1527 /* Dummy button to make crescent shape */
1528 { SDLK_y, 112, 265, 76, "None" },
1529 { SDLK_KP8, 74, 224, 28, "Scroll Back" },
1530 { SDLK_KP2, 146, 228, 28, "Scroll Fwd" },
1531 { SDLK_KP6, 159, 268, 64, "Right" },
1532 { SDLK_KP4, 62, 266, 62, "Left" },
1533 { SDLK_KP_PERIOD, 111, 216, 64, "Menu" },
1534 { SDLK_KP_PLUS, 111, 326, 55, "Down" },
1535 { 0, 0, 0 , 0, "None" }
1536};
1537#elif defined (IPOD_NANO)
1538struct button_map bm[] = {
1539 { SDLK_KP5, 98, 316, 37, "Select" },
1540 { SDLK_KP4, 37, 312, 28, "Left" },
1541 { SDLK_KP6, 160, 313, 25, "Right" },
1542 { SDLK_KP_PERIOD,102, 256, 23, "Menu" },
1543 { SDLK_KP_PLUS, 99, 378, 28, "Play" },
1544 { SDLK_KP8, 58, 272, 24, "Scroll Back" },
1545 { SDLK_KP2, 141, 274, 22, "Scroll Fwd" },
1546 { 0, 0, 0 , 0, "None" }
1547};
1548#elif defined (IPOD_NANO2G)
1549struct button_map bm[] = {
1550 { SDLK_KP5, 118, 346, 37, "Select" },
1551 { SDLK_KP4, 51, 345, 28, "Left" },
1552 { SDLK_KP6, 180, 346, 26, "Right" },
1553 { SDLK_KP_PERIOD, 114, 286, 23, "Menu" },
1554 { SDLK_KP_PLUS, 115, 412, 27, "Down" },
1555 { SDLK_KP8, 67, 303, 28, "Scroll Back" },
1556 { SDLK_KP2, 163, 303, 27, "Scroll Fwd" },
1557 { 0, 0, 0 , 0, "None" }
1558};
1559#elif defined (COWON_D2)
1560struct button_map bm[] = {
1561 { SDLK_DELETE, 51, 14, 17, "Power" },
1562 { SDLK_h, 138, 14, 16, "Hold" },
1563 { SDLK_MINUS, 320, 14, 10, "Minus" },
1564 { SDLK_INSERT, 347, 13, 13, "Menu" },
1565 { SDLK_KP_PLUS, 374, 14, 12, "Plus" },
1566 { 0, 0, 0, 0, "None" }
1567};
1568#elif defined (IAUDIO_M3)
1569struct button_map bm[] = {
1570 { SDLK_KP5, 256, 72, 29, "Play" },
1571 { SDLK_KP6, 255, 137, 28, "Right" },
1572 { SDLK_KP4, 257, 201, 26, "Left" },
1573 { SDLK_KP8, 338, 31, 27, "Up" },
1574 { SDLK_KP2, 339, 92, 23, "Down" },
1575 { SDLK_KP_DIVIDE, 336, 147, 23, "Rec" },
1576 { SDLK_h, 336, 212, 30, "Hold" },
1577 { 0, 0, 0, 0, "None" }
1578};
1579#elif defined (IAUDIO_M5)
1580struct button_map bm[] = {
1581 { SDLK_KP_ENTER, 333, 41, 17, "Enter" },
1582 { SDLK_h, 334, 74, 21, "Hold" },
1583 { SDLK_KP_DIVIDE, 333, 142, 24, "Record" },
1584 { SDLK_KP_PLUS, 332, 213, 20, "Play" },
1585 { SDLK_KP5, 250, 291, 19, "Select" },
1586 { SDLK_KP8, 249, 236, 32, "Up" },
1587 { SDLK_KP4, 194, 292, 29, "Left" },
1588 { SDLK_KP6, 297, 290, 27, "Right" },
1589 { SDLK_KP2, 252, 335, 28, "Down" },
1590 { 0, 0, 0, 0, "None" }
1591};
1592#elif defined (IAUDIO_7)
1593struct button_map bm[] = {
1594 { 0, 0, 0, 0, "None" }
1595};
1596#elif defined (IAUDIO_X5)
1597struct button_map bm[] = {
1598 { SDLK_KP_ENTER, 275, 38, 17, "Power" },
1599 { SDLK_h, 274, 83, 16, "Hold" },
1600 { SDLK_KP_DIVIDE, 276, 128, 22, "Record" },
1601 { SDLK_KP_PLUS, 274, 186, 22, "Play" },
1602 { SDLK_KP5, 200, 247, 16, "Select" },
1603 { SDLK_KP8, 200, 206, 16, "Up" },
1604 { SDLK_KP4, 163, 248, 19, "Left" },
1605 { SDLK_KP6, 225, 247, 24, "Right" },
1606 { SDLK_KP2, 199, 279, 20, "Down" },
1607 { 0, 0, 0, 0, "None" }
1608};
1609#elif defined (ARCHOS_PLAYER)
1610struct button_map bm[] = {
1611 { SDLK_KP_PLUS, 79, 252, 23, "On" },
1612 { SDLK_KP_PERIOD, 81, 310, 20, "Menu" },
1613 { SDLK_KP8, 154, 237, 28, "Play" },
1614 { SDLK_KP4, 121, 282, 23, "Left" },
1615 { SDLK_KP6, 187, 282, 22, "Right" },
1616 { SDLK_KP2, 157, 312, 20, "Down" },
1617 { 0, 0, 0, 0, "None" }
1618};
1619#elif defined (ARCHOS_RECORDER)
1620struct button_map bm[] = {
1621 { SDLK_F1, 94, 205, 22, "F1" },
1622 { SDLK_F2, 136, 204, 21, "F2" },
1623 { SDLK_F3, 174, 204, 24, "F3" },
1624 { SDLK_KP_PLUS, 75, 258, 19, "On" },
1625 { SDLK_KP_ENTER, 76, 307, 15, "Off" },
1626 { SDLK_KP5, 151, 290, 20, "Select" },
1627 { SDLK_KP8, 152, 251, 23, "Up" },
1628 { SDLK_KP4, 113, 288, 26, "Left" },
1629 { SDLK_KP6, 189, 291, 23, "Right" },
1630 { SDLK_KP2, 150, 327, 27, "Down" },
1631 { 0, 0, 0, 0, "None" }
1632};
1633#elif defined (ARCHOS_FMRECORDER) || defined (ARCHOS_RECORDERV2)
1634struct button_map bm[] = {
1635 { SDLK_F1, 88, 210, 28, "F1" },
1636 { SDLK_F2, 144, 212, 28, "F2" },
1637 { SDLK_F3, 197, 212, 28, "F3" },
1638 { SDLK_KP5, 144, 287, 21, "Select" },
1639 { SDLK_KP_PLUS, 86, 320, 13, "Menu" },
1640 { SDLK_KP_ENTER, 114, 347, 13, "Stop" },
1641 { SDLK_y, 144, 288, 31, "None" },
1642 { SDLK_KP8, 144, 259, 25, "Up" },
1643 { SDLK_KP2, 144, 316, 31, "Down" },
1644 { SDLK_KP6, 171, 287, 32, "Right" },
1645 { SDLK_KP4, 117, 287, 31, "Left" },
1646 { 0, 0, 0, 0, "None" }
1647};
1648#elif defined (ARCHOS_ONDIOSP) || defined (ARCHOS_ONDIOFM)
1649struct button_map bm[] = {
1650 { SDLK_KP_ENTER, 75, 23, 30, "Enter" },
1651 { SDLK_KP8, 75, 174, 33, "KP8" },
1652 { SDLK_KP4, 26, 186, 48, "KP4" },
1653 { SDLK_KP6, 118, 196, 32, "KP6" },
1654 { SDLK_KP2, 75, 234, 16, "KP2" },
1655 { SDLK_KP_PERIOD, 54, 250, 24, "Period" },
1656 { 0, 0, 0, 0, "None" }
1657};
1658#elif defined (IRIVER_H10)
1659struct button_map bm[] = {
1660 { SDLK_KP_PLUS, 38, 70, 37, "Power" },
1661 { SDLK_KP4, 123, 194, 26, "Cancel" },
1662 { SDLK_KP6, 257, 195, 34, "Select" },
1663 { SDLK_KP8, 190, 221, 28, "Up" },
1664 { SDLK_KP2, 192, 320, 27, "Down" },
1665 { SDLK_KP_DIVIDE, 349, 49, 20, "Rew" },
1666 { SDLK_KP5, 349, 96, 20, "Play" },
1667 { SDLK_KP_MULTIPLY, 350, 141, 23, "FF" },
1668 { 0, 0, 0, 0, "None" }
1669};
1670#elif defined (IRIVER_H10_5GB)
1671struct button_map bm[] = {
1672 { SDLK_KP_PLUS, 34, 76, 23, "Power" },
1673 { SDLK_KP4, 106, 222, 28, "Cancel" },
1674 { SDLK_KP6, 243, 220, 31, "Select" },
1675 { SDLK_KP8, 176, 254, 34, "Up" },
1676 { SDLK_KP2, 175, 371, 35, "Down" },
1677 { SDLK_KP_DIVIDE, 319, 63, 26, "Rew" },
1678 { SDLK_KP5, 320, 124, 26, "Play" },
1679 { SDLK_KP_MULTIPLY, 320, 181, 32, "FF" },
1680 { 0, 0, 0, 0, "None" }
1681};
1682#elif defined (IRIVER_H120) || defined (IRIVER_H100)
1683struct button_map bm[] = {
1684 { SDLK_KP_DIVIDE, 46, 162, 13, "Record" },
1685 { SDLK_KP_PLUS, 327, 36, 16, "Play" },
1686 { SDLK_KP_ENTER, 330, 99, 18, "Stop" },
1687 { SDLK_KP_PERIOD, 330, 163, 18, "AB" },
1688 { SDLK_KP5, 186, 227, 27, "5" },
1689 { SDLK_KP8, 187, 185, 19, "8" },
1690 { SDLK_KP4, 142, 229, 23, "4" },
1691 { SDLK_KP6, 231, 229, 22, "6" },
1692 { SDLK_KP2, 189, 272, 28, "2" },
1693/* Remote Buttons */
1694 { SDLK_KP_ENTER, 250, 404, 20, "Stop" },
1695 { SDLK_SPACE, 285, 439, 29, "Space" },
1696 { SDLK_h, 336, 291, 24, "Hold" },
1697 { 0, 0, 0, 0, "None" }
1698};
1699#elif defined (IRIVER_H300)
1700struct button_map bm[] = {
1701 { SDLK_KP_PLUS, 56, 335, 20, "Play" },
1702 { SDLK_KP8, 140, 304, 29, "Up" },
1703 { SDLK_KP_DIVIDE, 233, 331, 23, "Record" },
1704 { SDLK_KP_ENTER, 54, 381, 24, "Stop" },
1705 { SDLK_KP4, 100, 353, 17, "Left" },
1706 { SDLK_KP5, 140, 351, 19, "Navi" },
1707 { SDLK_KP6, 185, 356, 19, "Right" },
1708 { SDLK_KP_PERIOD, 230, 380, 20, "AB" },
1709 { SDLK_KP2, 142, 402, 24, "Down" },
1710 { SDLK_KP_ENTER, 211, 479, 21, "Stop" },
1711 { SDLK_KP_PLUS, 248, 513, 29, "Play" },
1712 { 0, 0, 0, 0, "None" }
1713};
1714#elif defined (MROBE_500)
1715struct button_map bm[] = {
1716 { SDLK_KP9, 171, 609, 9, "Play" },
1717 { SDLK_KP4, 158, 623, 9, "Left" },
1718 { SDLK_KP6, 184, 622, 9, "Right" },
1719 { SDLK_KP7, 171, 638, 11, "Menu" },
1720 { 0, 0, 0, 0, "None" }
1721};
1722#elif defined (MROBE_100)
1723struct button_map bm[] = {
1724 { SDLK_KP7, 80, 233, 30, "Menu" },
1725 { SDLK_KP8, 138, 250, 19, "Up" },
1726 { SDLK_KP9, 201, 230, 27, "Play" },
1727 { SDLK_KP4, 63, 305, 25, "Left" },
1728 { SDLK_KP5, 125, 309, 28, "Select" },
1729 { SDLK_KP6, 200, 307, 35, "Right" },
1730 { SDLK_KP1, 52, 380, 32, "Display" },
1731 { SDLK_KP2, 125, 363, 30, "Down" },
1732 { SDLK_KP9, 168, 425, 10, "Play" },
1733 { SDLK_KP4, 156, 440, 11, "Left" },
1734 { SDLK_KP6, 180, 440, 13, "Right" },
1735 { SDLK_KP7, 169, 452, 10, "Menu" },
1736 { SDLK_KP_MULTIPLY, 222, 15, 16, "Power" },
1737 { 0, 0, 0, 0, "None" }
1738};
1739#elif defined (GIGABEAT_F)
1740struct button_map bm[] = {
1741 { SDLK_KP_PLUS, 361, 187, 22, "Power" },
1742 { SDLK_KP_PERIOD, 361, 270, 17, "Menu" },
1743 { SDLK_KP9, 365, 345, 26, "Vol Up" },
1744 { SDLK_KP3, 363, 433, 25, "Vol Down" },
1745 { SDLK_KP_ENTER, 365, 520, 19, "A" },
1746 { SDLK_KP8, 167, 458, 35, "Up" },
1747 { SDLK_KP4, 86, 537, 29, "Left" },
1748 { SDLK_KP5, 166, 536, 30, "Select" },
1749 { SDLK_KP6, 248, 536, 30, "Right" },
1750 { SDLK_KP2, 169, 617, 28, "Down" },
1751 { 0, 0, 0, 0, "None" }
1752};
1753#elif defined (GIGABEAT_S)
1754struct button_map bm[] = {
1755 { SDLK_KP_PLUS, 416, 383, 23, "Play" },
1756 { SDLK_KP7, 135, 442, 46, "Back" },
1757 { SDLK_KP9, 288, 447, 35, "Menu" },
1758 { SDLK_KP8, 214, 480, 32, "Up" },
1759 { SDLK_KP4, 128, 558, 33, "Left" },
1760 { SDLK_KP5, 214, 556, 34, "Select" },
1761 { SDLK_KP6, 293, 558, 35, "Right" },
1762 { SDLK_KP2, 214, 637, 38, "Down" },
1763 { 0, 0, 0, 0, "None" }
1764};
1765#elif defined (SAMSUNG_YH820)
1766struct button_map bm[] = {
1767 { SDLK_KP_PLUS, 330, 53, 23, "Record" },
1768 { SDLK_KP7, 132, 208, 21, "Left" },
1769 { SDLK_KP5, 182, 210, 18, "Play" },
1770 { SDLK_KP9, 234, 211, 22, "Right" },
1771 { SDLK_KP8, 182, 260, 15, "Up" },
1772 { SDLK_KP4, 122, 277, 29, "Menu" },
1773 { SDLK_KP6, 238, 276, 25, "Select" },
1774 { SDLK_KP2, 183, 321, 24, "Down" },
1775 { 0, 0, 0, 0, "None" }
1776};
1777#elif defined (SAMSUNG_YH920) || defined (SAMSUNG_YH925)
1778struct button_map bm[] = {
1779 { SDLK_KP9, 370, 32, 15, "FF" },
1780 { SDLK_KP5, 369, 84, 25, "Play" },
1781 { SDLK_KP5, 367, 125, 27, "Play" },
1782 { SDLK_KP3, 369, 188, 17, "Rew" },
1783 { SDLK_KP_PLUS, 370, 330, 30, "Record" },
1784 { SDLK_KP4, 146, 252, 32, "Menu" },
1785 { SDLK_KP8, 204, 226, 27, "Up" },
1786 { SDLK_KP6, 257, 250, 34, "Select" },
1787 { SDLK_KP2, 205, 294, 35, "Down" },
1788 { 0, 0, 0, 0, "None" }
1789};
1790#elif defined (ONDA_VX747) || defined (ONDA_VX747P)
1791struct button_map bm[] = {
1792 { SDLK_MINUS, 113, 583, 28, "Minus" },
1793 { SDLK_PLUS, 227, 580, 28, "Plus" },
1794 { SDLK_RETURN, 171, 583, 34, "Menu" },
1795 { 0, 0, 0, 0, "None" }
1796};
1797#elif defined (PHILIPS_SA9200)
1798struct button_map bm[] = {
1799 { SDLK_KP_ENTER, 25, 155, 33, "Power" },
1800 { SDLK_PAGEUP, 210, 98, 31, "Vol Up" },
1801 { SDLK_PAGEDOWN, 210, 168, 34, "Vol Down" },
1802 { SDLK_KP7, 40, 249, 26, "Prev" },
1803 { SDLK_KP8, 110, 247, 22, "Up" },
1804 { SDLK_KP9, 183, 249, 31, "Next" },
1805 { SDLK_KP4, 45, 305, 25, "Left" },
1806 { SDLK_KP5, 111, 304, 24, "Play" },
1807 { SDLK_KP6, 183, 304, 21, "Right" },
1808 { SDLK_KP1, 43, 377, 21, "Menu" },
1809 { SDLK_KP2, 112, 371, 24, "Down" },
1810 { 0, 0, 0, 0, "None" }
1811};
1812#elif defined (CREATIVE_ZVM) || defined (CREATIVE_ZVM60GB) || \
1813 defined (CREATIVE_ZV)
1814struct button_map bm[] = {
1815 { SDLK_KP7, 52, 414, 35, "Custom" },
1816 { SDLK_KP8, 185, 406, 55, "Up" },
1817 { SDLK_KP9, 315, 421, 46, "Play" },
1818 { SDLK_KP4, 122, 500, 41, "Left" },
1819 { SDLK_KP6, 247, 493, 49, "Right" },
1820 { SDLK_KP1, 58, 577, 49, "Back" },
1821 { SDLK_KP2, 186, 585, 46, "Down" },
1822 { SDLK_KP3, 311, 569, 47, "Menu" },
1823 { 0, 0, 0, 0, "None" }
1824};
1825#else
1826struct button_map bm[] = {
1827 { 0, 0, 0, 0, ""}
1828};
1829#endif
1830
1831int xy2button( int x, int y) {
1832 int i;
1833 extern bool debug_buttons;
1834
1835 for ( i = 0; bm[i].button; i++ )
1836 /* check distance from center of button < radius */
1837 if ( ( (x-bm[i].x)*(x-bm[i].x) ) + ( ( y-bm[i].y)*(y-bm[i].y) ) < bm[i].radius*bm[i].radius ) {
1838 if (debug_buttons)
1839 printf("Button: %s\n", bm[i].description );
1840 return bm[i].button;
1841 }
1842 return 0;
1843}