Changeset 698

Show
Ignore:
Timestamp:
02/08/08 08:12:45 (8 months ago)
Author:
takkaria
Message:

Add Nick McConnell?'s mouse button patch. This adds FA-style buttons at the bottom of the screen, but it has a couple of problems related to redraw.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/Makefile.inc

    r667 r698  
    1616attack.o: attack.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    1717  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    18   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     18  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    1919birth.o: birth.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    2020  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    21   option.h types.h ui.h z-type.h externs.h object.h cmds.h ui-menu.h 
     21  option.h types.h ui.h z-type.h object.h externs.h cmds.h ui-menu.h 
     22button.o: button.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
     23  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
     24  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    2225cave.o: cave.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    2326  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    24   option.h types.h ui.h z-type.h externs.h object.h game-event.h 
     27  option.h types.h ui.h z-type.h object.h externs.h game-event.h 
    2528compress.o: compress.c compress.h h-basic.h 
    2629cmd0.o: cmd0.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    2730  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    28   option.h types.h ui.h z-type.h externs.h object.h wizard.h cmds.h \ 
     31  option.h types.h ui.h z-type.h object.h externs.h wizard.h cmds.h \ 
    2932  ui-menu.h 
    3033cmd1.o: cmd1.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    3134  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    32   option.h types.h ui.h z-type.h externs.h object.h cmds.h 
     35  option.h types.h ui.h z-type.h object.h externs.h cmds.h 
    3336cmd2.o: cmd2.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    3437  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    35   option.h types.h ui.h z-type.h externs.h object.h 
     38  option.h types.h ui.h z-type.h object.h externs.h 
    3639cmd3.o: cmd3.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    3740  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    38   option.h types.h ui.h z-type.h externs.h object.h 
     41  option.h types.h ui.h z-type.h object.h externs.h 
    3942cmd4.o: cmd4.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    4043  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    41   option.h types.h ui.h z-type.h externs.h object.h ui-menu.h 
     44  option.h types.h ui.h z-type.h object.h externs.h ui-menu.h 
    4245cmd5.o: cmd5.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    4346  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    44   option.h types.h ui.h z-type.h externs.h object.h 
     47  option.h types.h ui.h z-type.h object.h externs.h 
    4548cmd6.o: cmd6.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    4649  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    47   option.h types.h ui.h z-type.h externs.h object.h cmds.h effects.h 
     50  option.h types.h ui.h z-type.h object.h externs.h cmds.h effects.h 
    4851cmd-obj.o: cmd-obj.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    4952  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    50   defines.h option.h types.h ui.h z-type.h externs.h object.h cmds.h 
     53  defines.h option.h types.h ui.h z-type.h object.h externs.h cmds.h 
    5154death.o: death.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    5255  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    53   option.h types.h ui.h z-type.h externs.h object.h ui-menu.h 
     56  option.h types.h ui.h z-type.h object.h externs.h ui-menu.h 
    5457debug.o: debug.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    5558  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    56   option.h types.h ui.h z-type.h externs.h object.h debug.h 
     59  option.h types.h ui.h z-type.h object.h externs.h debug.h 
    5760dungeon.o: dungeon.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    5861  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    59   defines.h option.h types.h ui.h z-type.h externs.h object.h cmds.h 
     62  defines.h option.h types.h ui.h z-type.h object.h externs.h cmds.h 
    6063effects.o: effects.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    6164  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    62   defines.h option.h types.h ui.h z-type.h externs.h object.h effects.h 
     65  defines.h option.h types.h ui.h z-type.h object.h externs.h effects.h 
    6366files.o: files.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    6467  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    65   option.h types.h ui.h z-type.h externs.h object.h ui-menu.h cmds.h 
     68  option.h types.h ui.h z-type.h object.h externs.h ui-menu.h cmds.h 
    6669game-cmd.o: game-cmd.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    6770  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    68   defines.h option.h types.h ui.h z-type.h externs.h object.h game-cmd.h 
     71  defines.h option.h types.h ui.h z-type.h object.h externs.h game-cmd.h 
    6972game-event.o: game-event.c z-virt.h h-basic.h game-event.h 
    7073generate.o: generate.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    7174  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    72   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     75  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    7376history.o: history.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    7477  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    75   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     78  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    7679init1.o: init1.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    7780  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    78   option.h types.h ui.h z-type.h externs.h object.h effects.h init.h 
     81  option.h types.h ui.h z-type.h object.h externs.h effects.h init.h 
    7982init2.o: init2.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    8083  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    81   option.h types.h ui.h z-type.h externs.h object.h init.h cmds.h \ 
     84  option.h types.h ui.h z-type.h object.h externs.h init.h cmds.h \ 
    8285  game-event.h game-cmd.h 
    8386load.o: load.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    8487  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    85   option.h types.h ui.h z-type.h externs.h object.h 
     88  option.h types.h ui.h z-type.h object.h externs.h 
    8689loadsave.o: loadsave.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    8790  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    88   defines.h option.h types.h ui.h z-type.h externs.h object.h \ 
     91  defines.h option.h types.h ui.h z-type.h object.h externs.h \ 
    8992  z-blockfile.h z-smap.h 
    9093melee1.o: melee1.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    9194  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    92   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     95  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    9396melee2.o: melee2.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    9497  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    95   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     98  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    9699monster1.o: monster1.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    97100  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    98   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     101  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    99102monster2.o: monster2.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    100103  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    101   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     104  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    102105obj-desc.o: obj-desc.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    103106  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    104   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     107  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    105108obj-info.o: obj-info.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    106109  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    107   defines.h option.h types.h ui.h z-type.h externs.h object.h effects.h \ 
     110  defines.h option.h types.h ui.h z-type.h object.h externs.h effects.h \ 
    108111  cmds.h 
    109112obj-make.o: obj-make.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    110113  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    111   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     114  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    112115obj-ui.o: obj-ui.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    113116  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    114   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     117  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    115118obj-util.o: obj-util.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    116119  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    117   defines.h option.h types.h ui.h z-type.h externs.h object.h randname.h 
     120  defines.h option.h types.h ui.h z-type.h object.h externs.h randname.h 
    118121option.o: option.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    119122  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    120   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     123  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    121124randart.o: randart.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    122125  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    123   defines.h option.h types.h ui.h z-type.h externs.h object.h init.h \ 
     126  defines.h option.h types.h ui.h z-type.h object.h externs.h init.h \ 
    124127  randname.h 
    125128randname.o: randname.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    126129  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    127   defines.h option.h types.h ui.h z-type.h externs.h object.h randname.h 
     130  defines.h option.h types.h ui.h z-type.h object.h externs.h randname.h 
    128131pathfind.o: pathfind.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    129132  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    130   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     133  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    131134score.o: score.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    132135  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    133   option.h types.h ui.h z-type.h externs.h object.h 
     136  option.h types.h ui.h z-type.h object.h externs.h 
    134137signals.o: signals.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    135138  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    136   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     139  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    137140save.o: save.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    138141  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    139   option.h types.h ui.h z-type.h externs.h object.h 
     142  option.h types.h ui.h z-type.h object.h externs.h 
    140143spells1.o: spells1.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    141144  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    142   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     145  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    143146spells2.o: spells2.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    144147  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    145   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     148  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    146149squelch.o: squelch.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    147150  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    148   defines.h option.h types.h ui.h z-type.h externs.h object.h cmds.h \ 
     151  defines.h option.h types.h ui.h z-type.h object.h externs.h cmds.h \ 
    149152  ui-menu.h 
    150153store.o: store.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    151154  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    152   option.h types.h ui.h z-type.h externs.h object.h cmds.h ui-menu.h 
     155  option.h types.h ui.h z-type.h object.h externs.h cmds.h ui-menu.h 
    153156tables.o: tables.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    154157  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    155   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     158  defines.h option.h types.h ui.h z-type.h object.h externs.h 
     159target.o: target.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
     160  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
     161  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    156162trap.o: trap.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    157163  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    158   option.h types.h ui.h z-type.h externs.h object.h 
     164  option.h types.h ui.h z-type.h object.h externs.h 
    159165ui.o: ui.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    160166  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    161   option.h types.h ui.h z-type.h externs.h object.h 
     167  option.h types.h ui.h z-type.h object.h externs.h 
    162168ui-event.o: ui-event.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    163169  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    164   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     170  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    165171ui-menu.o: ui-menu.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    166172  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    167   defines.h option.h types.h ui.h z-type.h externs.h object.h ui-menu.h 
     173  defines.h option.h types.h ui.h z-type.h object.h externs.h ui-menu.h 
    168174util.o: util.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    169175  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    170   option.h types.h ui.h z-type.h externs.h object.h randname.h 
     176  option.h types.h ui.h z-type.h object.h externs.h randname.h 
    171177variable.o: variable.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    172178  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    173   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     179  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    174180wiz-spoil.o: wiz-spoil.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    175181  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    176   defines.h option.h types.h ui.h z-type.h externs.h object.h cmds.h 
     182  defines.h option.h types.h ui.h z-type.h object.h externs.h cmds.h 
    177183wiz-stats.o: wiz-stats.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    178184  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    179   defines.h option.h types.h ui.h z-type.h externs.h object.h wizard.h 
     185  defines.h option.h types.h ui.h z-type.h object.h externs.h wizard.h 
    180186wizard.o: wizard.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    181187  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    182   defines.h option.h types.h ui.h z-type.h externs.h object.h wizard.h \ 
     188  defines.h option.h types.h ui.h z-type.h object.h externs.h wizard.h \ 
    183189  cmds.h 
    184190x-spell.o: x-spell.c angband.h h-basic.h z-file.h z-form.h z-util.h \ 
    185191  z-virt.h z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h \ 
    186   defines.h option.h types.h ui.h z-type.h externs.h object.h 
     192  defines.h option.h types.h ui.h z-type.h object.h externs.h 
    187193xtra1.o: xtra1.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    188194  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    189   option.h types.h ui.h z-type.h externs.h object.h game-event.h 
     195  option.h types.h ui.h z-type.h object.h externs.h game-event.h 
    190196xtra2.o: xtra2.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    191197  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    192   option.h types.h ui.h z-type.h externs.h object.h cmds.h 
     198  option.h types.h ui.h z-type.h object.h externs.h cmds.h 
    193199xtra3.o: xtra3.c angband.h h-basic.h z-file.h z-form.h z-util.h z-virt.h \ 
    194200  z-rand.h z-term.h ui-event.h z-quark.h z-msg.h config.h defines.h \ 
    195   option.h types.h ui.h z-type.h externs.h object.h game-event.h 
     201  option.h types.h ui.h z-type.h object.h externs.h game-event.h 
    196202z-file.o: z-file.c z-file.h h-basic.h z-virt.h z-util.h z-form.h 
    197203z-form.o: z-form.c z-form.h h-basic.h z-type.h z-util.h z-virt.h 
  • trunk/src/Makefile.src

    r670 r698  
    5151        attack.o \ 
    5252        birth.o \ 
     53        button.o \ 
    5354        cave.o \ 
    5455        compress.o \ 
  • trunk/src/birth.c

    r691 r698  
    11151115 
    11161116        char ch; 
     1117        ui_event_data ke; 
    11171118 
    11181119        char buf[80]; 
     
    12231224                prt(buf, 0, 0); 
    12241225 
     1226                /* Buttons */ 
     1227                clear_from(Term->hgt - 2); 
     1228                button_kill_all(); 
     1229                button_add("[Back]", ESCAPE); 
     1230                button_add("[Done]", '\r'); 
     1231                button_add("[Up]", '8'); 
     1232                button_add("[Down]", '2'); 
     1233                button_add("[Incr]", '6'); 
     1234                button_add("[Decr]", '4'); 
     1235                redraw_stuff(); 
     1236 
    12251237                /* Place cursor just after cost of current stat */ 
    12261238                Term_gotoxy(col + 36, row + stat); 
    12271239 
    12281240                /* Get key */ 
    1229                 ch = inkey(); 
     1241                ke = inkey_ex(); 
     1242                ch = ke.key; 
    12301243 
    12311244                if (ch == KTRL('X'))  
     
    12741287 
    12751288 
     1289        /* Kill buttons */ 
     1290        button_kill_all(); 
     1291        redraw_stuff(); 
     1292   
    12761293        /* Done - advance a step*/ 
    12771294        return +1; 
     
    13011318 
    13021319        char ch; 
     1320        ui_event_data ke; 
    13031321 
    13041322        char b1 = '['; 
     
    15481566 
    15491567                                                /* Check for a keypress */ 
    1550                                                 if (inkey()) break; 
     1568                                                if (anykey()) break; 
    15511569                                        } 
    15521570                                } 
     
    15981616                        /* Display the player */ 
    15991617                        display_player(0); 
     1618 
     1619                        /* Add buttons */ 
     1620                        button_add("[ESC]", ESCAPE); 
     1621                        button_add("[Enter]", '\r'); 
     1622                        button_add("[r]", 'r'); 
     1623                        if (prev) button_add("[p]", 'p'); 
     1624                        clear_from(Term->hgt - 2); 
     1625                        redraw_stuff(); 
    16001626 
    16011627                        /* Prepare a prompt (must squeeze everything in) */ 
     
    16081634 
    16091635                        /* Prompt and get a command */ 
    1610                         ch = inkey(); 
     1636                        ke = inkey_ex(); 
     1637                        ch = ke.key; 
    16111638 
    16121639                        /* Go back to the start of the step, or the previous step */ 
     
    16141641                        if (ch == ESCAPE)  
    16151642                        { 
     1643                                button_kill('r'); 
     1644                                button_kill('p'); 
    16161645                                if (autoroll)  
    16171646                                        return 0; 
     
    16461675                        bell("Illegal auto-roller command!"); 
    16471676                } 
     1677 
     1678                /* Kill buttons */ 
     1679                button_kill(ESCAPE); 
     1680                button_kill('\r'); 
     1681                button_kill('r'); 
     1682                button_kill('p'); 
     1683                redraw_stuff(); 
    16481684 
    16491685                /* Are we done? */ 
     
    16821718static void player_birth_aux(void) 
    16831719{ 
    1684         char ch
     1720        ui_event_data ke
    16851721        cptr prompt = "['ESC' to step back, 'S' to start over, or any other key to continue]"; 
    16861722        birth_stages state = BIRTH_QUESTIONS; 
     
    17421778                                prt(prompt, Term->hgt - 1, Term->wid / 2 - strlen(prompt) / 2); 
    17431779 
     1780                                /* Buttons */ 
     1781                                button_kill_all(); 
     1782                                button_add("[Continue]", 'q'); 
     1783                                button_add("[ESC]", ESCAPE); 
     1784                                button_add("[S]", 'S'); 
     1785                                redraw_stuff(); 
     1786             
    17441787                                /* Get a key */ 
    1745                                 ch = inkey(); 
     1788                                ke = inkey_ex(); 
    17461789 
    17471790                                /* Start over */ 
    1748                                 if (ch == 'S')  
     1791                                if (ke.key == 'S')  
    17491792                                        state = BIRTH_RESTART; 
    17501793 
    1751                                 if (ch == KTRL('X'))  
     1794                                if (ke.key == KTRL('X'))  
    17521795                                        quit(NULL); 
    17531796 
    1754                                 if (ch == ESCAPE)  
     1797                                if (ke.key == ESCAPE)  
    17551798                                        state--; 
    17561799                                else 
    17571800                                        state++; 
    17581801 
     1802                                /* Buttons */ 
     1803                                button_kill_all(); 
     1804                                redraw_stuff(); 
     1805             
    17591806                                /* Clear prompt */ 
    17601807                                clear_from(23); 
     
    17801827static bool player_birth_quick(void) 
    17811828{ 
    1782         char ch
     1829        ui_event_data ke
    17831830        int i; 
    17841831        birther old_char; 
     
    18741921        prt("['CTRL-X' to quit, 'ESC' to start over, or any other key to continue]", 23, 5); 
    18751922 
     1923        /* Buttons */ 
     1924        button_kill_all(); 
     1925        button_add("[Continue]", 'q'); 
     1926        button_add("[ESC]", ESCAPE); 
     1927        button_add("[Exit]", KTRL('X')); 
     1928        redraw_stuff(); 
     1929             
    18761930        /* Get a key */ 
    1877         ch = inkey(); 
     1931        ke = inkey_ex(); 
    18781932 
    18791933        /* Quit */ 
    1880         if (ch == KTRL('X')) quit(NULL); 
     1934        if (ke.key == KTRL('X')) quit(NULL); 
    18811935 
    18821936        /* Start over */ 
    1883         if (ch == ESCAPE) return (FALSE); 
     1937        if (ke.key == ESCAPE) return (FALSE); 
    18841938 
    18851939        /* Accept */ 
     
    18981952{ 
    18991953        bool quickstart = FALSE; 
    1900         char ch
     1954        ui_event_data ke
    19011955 
    19021956        /* 
     
    19111965 
    19121966                        put_str("Quick-start character based on previous one (y/n)? ", 2, 2); 
    1913                         ch = inkey(); 
    1914  
    1915                         if (ch == KTRL('X')) 
     1967 
     1968                        /* Buttons */ 
     1969                        button_kill_all(); 
     1970                        button_add("[Exit]", KTRL('X')); 
     1971                        button_add("[ESC]", ESCAPE); 
     1972                        button_add("[y]", 'y'); 
     1973                        button_add("[n]", 'n'); 
     1974                        button_add("[Help]", '?'); 
     1975 
     1976                        ke = inkey_ex(); 
     1977 
     1978                        if (ke.key == KTRL('X')) 
    19161979                                quit(NULL); 
    1917                         else if ((ch == ESCAPE) || strchr("YyNn\r\n", ch)) 
     1980                        else if ((ke.key == ESCAPE) || strchr("YyNn\r\n", ke.key)) 
    19181981                                break; 
    1919                         else if (ch == '?') 
     1982                        else if (ke.key == '?') 
    19201983                                (void)show_file("birth.hlp", NULL, 0, 0); 
    19211984                        else 
     
    19241987 
    19251988                /* Quick generation */ 
    1926                 if ((ch == 'y') || (ch == 'Y')) 
     1989                if ((ke.key == 'y') || (ke.key == 'Y')) 
    19271990                { 
    19281991                        if (player_birth_quick()) quickstart = TRUE; 
  • trunk/src/cave.c

    r638 r698  
    16371637 
    16381638        /* Get any key */ 
    1639         (void)inkey(); 
     1639        (void)anykey(); 
    16401640 
    16411641        /* Load screen */ 
  • trunk/src/cmd0.c

    r595 r698  
    390390 
    391391        /* Wait */ 
    392         inkey(); 
     392        anykey(); 
    393393 
    394394        /* Return */ 
  • trunk/src/cmd3.c

    r678 r698  
    835835{ 
    836836        int i, n, r_idx; 
    837         char sym, query
     837        char sym
    838838        char buf[128]; 
     839 
     840        ui_event_data query; 
    839841 
    840842        bool all = FALSE; 
     
    917919        } 
    918920 
     921        /* Buttons */ 
     922        button_add("[y]", 'y'); 
     923        button_add("[k]", 'k'); 
     924        /* Don't collide with the repeat button */ 
     925        button_add("[n]", 'q');  
     926        redraw_stuff(); 
    919927 
    920928        /* Prompt */ 
     
    922930 
    923931        /* Query */ 
    924         query = inkey(); 
     932        query = inkey_ex(); 
    925933 
    926934        /* Restore */ 
    927935        prt(buf, 0, 0); 
    928936 
     937        /* Buttons */ 
     938        button_kill('y'); 
     939        button_kill('k'); 
     940        button_kill('q'); 
     941        redraw_stuff(); 
     942 
    929943        /* Interpret the response */ 
    930         if (query == 'k') 
     944        if (query.key == 'k') 
    931945        { 
    932946                /* Sort by kills (and level) */ 
    933947                why = 4; 
    934948        } 
    935         else if (query == 'y' || query == 'p') 
     949        else if (query.key == 'y' || query.key == 'p') 
    936950        { 
    937951                /* Sort by level; accept 'p' as legacy */ 
     
    958972        /* Start at the end */ 
    959973        i = n - 1; 
     974 
     975        /* Button */ 
     976        button_add("[r]", 'r'); 
     977        button_add("[-]", '-'); 
     978        button_add("[+]", '+'); 
     979        redraw_stuff(); 
    960980 
    961981        /* Scan the monster memory */ 
     
    9941014 
    9951015                        /* Command */ 
    996                         query = inkey(); 
     1016                        query = inkey_ex(); 
    9971017 
    9981018                        /* Unrecall */ 
     
    10041024 
    10051025                        /* Normal commands */ 
    1006                         if (query != 'r') break; 
     1026                        if (query.key != 'r') break; 
    10071027 
    10081028                        /* Toggle recall */ 
     
    10111031 
    10121032                /* Stop scanning */ 
    1013                 if (query == ESCAPE) break; 
     1033                if (query.key == ESCAPE) break; 
    10141034 
    10151035                /* Move to "prev" monster */ 
    1016                 if (query == '-') 
     1036                if (query.key == '-') 
    10171037                { 
    10181038                        if (++i == n) 
     
    10281048        } 
    10291049 
     1050        /* Button */ 
     1051        button_kill('r'); 
     1052        button_kill('-'); 
     1053        button_kill('+'); 
     1054        redraw_stuff(); 
    10301055 
    10311056        /* Re-display the identity */ 
  • trunk/src/cmd5.c

    r526 r698  
    482482 
    483483        /* Wait for input */ 
    484         (void)inkey(); 
     484        (void)anykey(); 
    485485 
    486486        /* Load screen */ 
  • trunk/src/defines.h

    r689 r698  
    16281628#define PR_OBJECT               0x00800000L /* Display object recall */ 
    16291629#define PR_MONLIST              0x01000000L /* Display monster list */ 
     1630#define PR_BUTTONS              0x02000000L     /* Display mouse buttons */ 
    16301631 
    16311632/* Display Basic Info */ 
  • trunk/src/dungeon.c

    r676 r698  
    15261526        /* Combine / Reorder the pack */ 
    15271527        p_ptr->notice |= (PN_COMBINE | PN_REORDER); 
     1528 
     1529        /* Make basic mouse buttons */ 
     1530        (void) button_add("[ESC]", ESCAPE); 
     1531        (void) button_add("[Ret]", '\r'); 
     1532        (void) button_add("[Spc]", ' '); 
     1533        (void) button_add("[Rpt]", 'n'); 
     1534        (void) button_add("[Std]", ','); 
     1535 
     1536        /* Redraw buttons */ 
     1537        p_ptr->redraw |= (PR_BUTTONS); 
    15281538 
    15291539        /* Notice stuff */ 
  • trunk/src/externs.h

    r695 r698  
    265265extern void player_birth(void); 
    266266 
     267/* button.c */ 
     268int button_add_text(const char *label, unsigned char keypress); 
     269int button_add(char *label, unsigned char keypress); 
     270void button_backup_all(void); 
     271void button_restore(void); 
     272int button_kill_text(unsigned char keypress); 
     273int button_kill(unsigned char keypress); 
     274void button_kill_all(void); 
     275void button_init(button_add_f add, button_kill_f kill); 
     276char button_get_key(int x, int y); 
     277size_t button_print(int row, int col); 
     278 
    267279/* cave.c */ 
    268280extern int distance(int y1, int x1, int y2, int x2); 
  • trunk/src/game-event.h

    r541 r698  
    2525        EVENT_STATE,            /* The three 'R's: Resting, Repeating and 
    2626                                   Searching */ 
     27        EVENT_MOUSEBUTTONS,     /* Displayed mouse buttons need changing */ 
    2728 
    2829        EVENT_PLAYERMOVED, 
  • trunk/src/init2.c

    r617 r698  
    10791079 
    10801080 
     1081        /*** Prepare mouse buttons ***/ 
     1082 
     1083        button_init(button_add_text, button_kill_text); 
     1084 
     1085 
    10811086        /*** Prepare quest array ***/ 
    10821087 
  • trunk/src/obj-ui.c

    r665 r698  
    750750        int px = p_ptr->px; 
    751751 
    752         char which; 
     752        ui_event_data which; 
    753753 
    754754        int j, k; 
     
    981981 
    982982                        /* Indicate ability to "view" */ 
    983                         if (!p_ptr->command_see) my_strcat(out_val, " * to see,", sizeof(out_val)); 
     983                        if (!p_ptr->command_see) 
     984                        { 
     985                                my_strcat(out_val, " * to see,", sizeof(out_val)); 
     986                                button_add("[*]", '*'); 
     987                        } 
    984988 
    985989                        /* Indicate legality of "toggle" */ 
    986                         if (use_equip) my_strcat(out_val, " / for Equip,", sizeof(out_val)); 
     990                        if (use_equip) 
     991                        { 
     992                                my_strcat(out_val, " / for Equip,", sizeof(out_val)); 
     993                                button_add("[/]", '/'); 
     994                        } 
    987995 
    988996                        /* Indicate legality of the "floor" */ 
    989                         if (allow_floor) my_strcat(out_val, " - for floor,", sizeof(out_val)); 
     997                        if (allow_floor) 
     998                        { 
     999                                my_strcat(out_val, " - for floor,", sizeof(out_val)); 
     1000                                button_add("[-]", '-'); 
     1001                        } 
    9901002 
    9911003                        /* Indicate that squelched items can be selected */ 
    992                         if (can_squelch) my_strcat(out_val, " ! for squelched,", sizeof(out_val)); 
     1004                        if (can_squelch) 
     1005                        { 
     1006                                my_strcat(out_val, " ! for squelched,", sizeof(out_val)); 
     1007                                button_add("[!]", '!'); 
     1008                        } 
    9931009                } 
    9941010 
     
    10141030 
    10151031                        /* Indicate ability to "view" */ 
    1016                         if (!p_ptr->command_see) my_strcat(out_val, " * to see,", sizeof(out_val)); 
     1032                        if (!p_ptr->command_see) 
     1033                        { 
     1034                                my_strcat(out_val, " * to see,", sizeof(out_val)); 
     1035                                button_add("[*]", '*'); 
     1036                        } 
    10171037 
    10181038                        /* Indicate legality of "toggle" */ 
    1019                         if (use_inven) my_strcat(out_val, " / for Inven,", sizeof(out_val)); 
     1039                        if (use_inven) 
     1040                        { 
     1041                                my_strcat(out_val, " / for Inven,", sizeof(out_val)); 
     1042                                button_add("[/]", '/'); 
     1043                        } 
    10201044 
    10211045                        /* Indicate legality of the "floor" */ 
    1022                         if (allow_floor) my_strcat(out_val, " - for floor,", sizeof(out_val)); 
     1046                        if (allow_floor) 
     1047                        { 
     1048                                my_strcat(out_val, " - for floor,", sizeof(out_val)); 
     1049                                button_add("[!]", '!'); 
     1050                        } 
    10231051                } 
    10241052 
     
    10431071 
    10441072                        /* Indicate ability to "view" */ 
    1045                         if (!p_ptr->command_see) my_strcat(out_val, " * to see,", sizeof(out_val)); 
     1073                        if (!p_ptr->command_see) 
     1074                        { 
     1075                                my_strcat(out_val, " * to see,", sizeof(out_val)); 
     1076                                button_add("[*]", '*'); 
     1077                        } 
    10461078 
    10471079                        /* Append */ 
    1048                         if (use_inven) my_strcat(out_val, " / for Inven,", sizeof(out_val)); 
     1080                        if (use_inven) 
     1081                        { 
     1082                                my_strcat(out_val, " / for Inven,", sizeof(out_val)); 
     1083                                button_add("[/]", '/'); 
     1084                        } 
    10491085 
    10501086                        /* Append */ 
    1051                         else if (use_equip) my_strcat(out_val, " / for Equip,", sizeof(out_val)); 
     1087                        else if (use_equip) 
     1088                        { 
     1089                                my_strcat(out_val, " / for Equip,", sizeof(out_val)); 
     1090                                button_add("[/]", '/'); 
     1091                        } 
    10521092 
    10531093                        /* Indicate that squelched items can be selected */ 
    1054                         if (can_squelch) my_strcat(out_val, " ! for squelched,", sizeof(out_val)); 
    1055                 } 
     1094                        if (can_squelch) 
     1095                        { 
     1096                                my_strcat(out_val, " ! for squelched,", sizeof(out_val)); 
     1097                                button_add("[!]", '!'); 
     1098                        } 
     1099                } 
     1100 
     1101                redraw_stuff(); 
    10561102 
    10571103                /* Finish the prompt */ 
     
    10661112 
    10671113                /* Get a key */ 
    1068                 which = inkey(); 
     1114                which = inkey_ex(); 
    10691115 
    10701116                /* Parse it */ 
    1071                 switch (which
     1117                switch (which.key
    10721118                { 
    10731119                        case ESCAPE: 
     
    12181264                        { 
    12191265                                /* Look up the tag */ 
    1220                                 if (!get_tag(&k, which)) 
     1266                                if (!get_tag(&k, which.key)) 
    12211267                                { 
    12221268                                        bell("Illegal object choice (tag)!"); 
     
    13311377 
    13321378                                /* Note verify */ 
    1333                                 verify = (isupper((unsigned char)which) ? TRUE : FALSE); 
     1379                                verify = (isupper((unsigned char)which.key) ? TRUE : FALSE); 
    13341380