/[winpt]/trunk/Src/wptHotkey.cpp
ViewVC logotype

Diff of /trunk/Src/wptHotkey.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 270 by twoaday, Tue Jun 20 09:18:44 2006 UTC revision 271 by twoaday, Sun Nov 5 08:57:45 2006 UTC
# Line 57  const char* Line 57  const char*
57  hotkeys_strerror (void)  hotkeys_strerror (void)
58  {  {
59      switch (err_hotkey) {      switch (err_hotkey) {
60      case  0: return NULL;      case 0: return NULL;
61      case  1: return _("Clipboard Encrypt (ALT+CTRL+E)");      case 1: return _("Clipboard Encrypt (ALT+CTRL+E)");
62      case  2: return _("Clipboard Decrypt/Verify (ALT+CTRL+D)");      case 2: return _("Clipboard Decrypt/Verify (ALT+CTRL+D)");
63      case  3: return _("Clipboard Sign (ALT+CTRL+S)");      case 3: return _("Clipboard Sign (ALT+CTRL+S)");
64      case  4: return _("Clipboard Sign Encrypt (ALT+CTRL+B)");      case 4: return _("Clipboard Sign Encrypt (ALT+CTRL+B)");
65      case  5: return _("Current Window Encrypt (ALT+SHIFT+E)");      case 5: return _("Current Window Encrypt (ALT+SHIFT+E)");
66      case  6: return _("Current Window Decrypt/Verify (ALT+SHIFT+D)");      case 6: return _("Current Window Decrypt/Verify (ALT+SHIFT+D)");
67      case  7: return _("Current Window Sign (ALT+SHIFT+S)");      case 7: return _("Current Window Sign (ALT+SHIFT+S)");
68      case  8: return _("Current Window Sign Encrypt (ALT+SHIFT+B)");      case 8: return _("Current Window Sign Encrypt (ALT+SHIFT+B)");
69      default: return _("Unknown Hotkey");      default:return _("Unknown Hotkey");
70      }      }
71      return NULL;      return NULL;
72  }  }
# Line 76  hotkeys_strerror (void) Line 76  hotkeys_strerror (void)
76  int  int
77  hotkeys_register (HWND wnd)  hotkeys_register (HWND wnd)
78  {  {
79      int j = 0, rc = 0;      int j;
80        int rc = 0;
81                    
82      err_hotkey = 0; /* reset */      err_hotkey = 0; /* reset */
83      for (j=0; wpt_hotkeys[j].id != 0; j++) {      for (j=0; wpt_hotkeys[j].id != 0; j++) {
# Line 97  hotkeys_register (HWND wnd) Line 98  hotkeys_register (HWND wnd)
98  int  int
99  hotkeys_unregister (HWND wnd)  hotkeys_unregister (HWND wnd)
100  {  {
101      int j = 0;      int j;
102    
103      for (j=0; wpt_hotkeys[j].id != 0; j++)      for (j=0; wpt_hotkeys[j].id != 0; j++)
104          hotkey_unregister_single (wnd, &wpt_hotkeys[j]);          hotkey_unregister_single (wnd, &wpt_hotkeys[j]);
# Line 121  hotkey_register_single (HWND wnd, hotkey Line 122  hotkey_register_single (HWND wnd, hotkey
122          keymod = MOD_ALT | MOD_SHIFT;          keymod = MOD_ALT | MOD_SHIFT;
123    
124      rc = RegisterHotKey (wnd, hk->id, keymod, hk->key);      rc = RegisterHotKey (wnd, hk->id, keymod, hk->key);
125      if (!rc)      return rc == 0? WPTERR_HOTKEY : 0;
         return WPTERR_HOTKEY;  
     return 0;  
126  }  }
127    
128    
# Line 131  hotkey_register_single (HWND wnd, hotkey Line 130  hotkey_register_single (HWND wnd, hotkey
130  int  int
131  hotkey_unregister_single (HWND wnd, hotkey_t hk)  hotkey_unregister_single (HWND wnd, hotkey_t hk)
132  {  {
133      int rc = 0;      int rc;
134    
135      rc = UnregisterHotKey (wnd, hk->id);      rc = UnregisterHotKey (wnd, hk->id);
136      return rc==0? WPTERR_HOTKEY: 0;      return rc==0? WPTERR_HOTKEY: 0;
137  }  }
138    
139    
140    /* Disable the given hotkey in @hk. */
141  void  void
142  hotkey_disable (hotkey_t hk)  hotkey_disable (hotkey_t hk)
143  {  {
# Line 145  hotkey_disable (hotkey_t hk) Line 145  hotkey_disable (hotkey_t hk)
145  }  }
146    
147    
148    /* Enable the given hotkey in @hk.
149       Set the hotkey sequence to @key. */
150  void  void
151  hotkey_enable (hotkey_t hk, const char *key)  hotkey_enable (hotkey_t hk, const char *key)
152  {  {

Legend:
Removed from v.270  
changed lines
  Added in v.271

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26