Hatena::Groupkeysnail

hogelogの日記

 | 

2010-03-04

hook-menu-popup.ks.js 0.0.2

13:01

以下のフックポイントをKeySnailに追加するプラグインを書きました。

  • MenuPopupShowing
  • MenuPopupHiding
  • MainMenuPopupShowing
  • MainMenuPopupHiding
  • ContextMenuPopupShowing
  • ContextMenuPopupHiding

http://github.com/hogelog/keysnail-plugins/blob/master/hook-menu-popup.ks.js

MainMenuPopupはメニューバーのメニュー、ContextMenuPopupは右クリックメニューへのフックです。これらのフックは他のフックポイントなどと同様にhook.setHook、hook.addToHookなどから利用できます。


私は以下のようにメニュー表示時はkeysnailを一時的に停止するために使っています。

function stopKeySnail (ev) {
    key.suspended = true;
}
function restartKeySnail (ev) {
    key.suspended = false;
}
hook.setHook('MenuPopupShowing', stopKeySnail);
hook.setHook('MenuPopupHiding', restartKeySnail);

というかこのために作ったのですけども。

余談: addEventListenerに渡す関数

no title

オブジェクトプロパティを渡すとthisがaddEventListenerを実行した時のそれになる。のでそれを回避しようと無名関数にくるんで渡すと無名関数アクセスできる変数全てを保持しておく必要があるからメモリ使用量が増大する、という意味だろうか。

とりあえず普通の関数にしておいてついでにremoveEventListenerしておくようにすれば問題ないのだろうけど。いまいち意味がわからない。EventListenerに起因する不具合はよく聞くような気がするのでこの辺の仕様を把握しておきたい。

MelloneyMelloney2011/12/11 09:55A million tnhkas for posting this information.

lhmaugmxzlhmaugmxz2011/12/11 17:10t8E2CF <a href="http://yilgumouqdmp.com/">yilgumouqdmp</a>

usunzewusunzew2011/12/11 21:47zdYsSS , [url=http://vvhduahiatpd.com/]vvhduahiatpd[/url], [link=http://epqzipsjsfsw.com/]epqzipsjsfsw[/link], http://rcgxzuglojau.com/

oecmnhctmnoecmnhctmn2011/12/13 19:53tG0JYV <a href="http://ojuwsagygqvx.com/">ojuwsagygqvx</a>

mrfjtotyamrfjtotya2011/12/14 00:12InBLii , [url=http://jxurzdlywjzd.com/]jxurzdlywjzd[/url], [link=http://llvcgponxaip.com/]llvcgponxaip[/link], http://yadzkfalnpgd.com/

AGeomCootaleAGeomCootale2018/02/03 12:15 Four to five portions of this fruit juice has to be consumed every week to get the desired result. Use these circumspectly however, while they may lower blood sugar levels, that is an undesirable effect that face men whose blood glucose levels are properly balanced.
https://www.cialissansordonnancefr24.com/cialis-ou-produit-naturel/

JamisonfoedyJamisonfoedy2018/02/09 12:09Shops that require protection for high risk goods held on the premises will usually need to declare the total values of each stock item. High risk shop stock and goods are those that attract thieves and are expensive to replace. Examples of high risk stock items are electronic equipment, cigarettes, and tobacco, designer clothing, computers and digital equipment, software, computer games and consoles, drugs pharmacy and medicines, watches and jewellery, mobile phones and radios, photographic equipment, power tools, TVs, DVDs, CDs and Wines and Spirits.

If your shop has high risk stock you can reduce the cost of your premiums by having adequate security in place. This includes an insurance company approved burglar and fire alarm, window grills, shutters and bars, CCTV and sprinklers. Many shop insurers will only offer stock cover if the minimum levels of security are in place for all shops, regardless of the stock contents held. A lot of insurers may offer further large discounts to the premium if the shop owner lives on or above the premises and is there at night.

Shops by their very nature deal with members of the public and a good insurance policy will usually contain liability cover as standard. This should include Public Liability of up to ?2,000,000 for any one claim by a member of the public who may suffer loss or injury visiting the shop.

If you employ staff all policies will offer Employers Liability cover of up to ?10,000,000 one event and because shops sell goods and services, Products Liability cover of ?2,000,000 for any one period of insurance.

<a href=https://www.cialissansordonnancefr24.com/pharmacie-discount-cialis/>https://www.cialissansordonnancefr24.com/pharmacie-discount-cialis/</a>

AlbertticAlberttic2018/05/31 02:56The prostate gland is central to the a part of a male's reproductive :. It secretes fluids that assist the transportation and activation of sperm. The prostate related can be found just before the rectum, below the bladder and around the urethra. When there is prostate problem, it will always be really really irritating and inconvenient for your patient as his urinary system is directly affected.

The common prostate health problems are prostate infection, enlarged prostate and prostate cancer.



Prostate infection, also called prostatitis, is easily the most common prostate-related problem in men younger than 55 years of age. Infections with the prostate gland are classified into four types - acute bacterial prostatitis, chronic bacterial prostatitis, chronic abacterial prostatitis and prosttodynia.

Acute bacterial prostatitis could be the least common of most types of prostate infection. It is caused by bacteria based in the large intestines or urinary tract. Patients may feel fever, chills, body aches, back pains and urination problems. This condition is treated by making use of antibiotics or non-steroid anti-inflammatory drugs (NSAIDs) to help remedy the swelling.

Chronic bacterial prostatitis is really a condition connected with a particular defect within the gland as well as the persistence presence of bacteria within the urinary tract. It can be due to trauma to the urinary tract or by infections received from the rest from the body. A patient may go through testicular pain, small of the back pains and urination problems. Although it is uncommon, it is usually treated by removal from the prostate defect accompanied by the use antibiotics and NSAIDs to treat the redness.

Non-bacterial prostatitis is the reason approximately 90% coming from all prostatitis cases; however, researchers have not yet to determine what causes these conditions. Some researchers believe that chronic non-bacterial prostatitis occur as a consequence of unknown infectious agents while other think that intensive exercise and heavy lifting can cause these infections.

Maintaining a Healthy Prostate

To prevent prostate diseases, a suitable diet is important. These are some of the actions to keep your prostate healthy.

1. Drink sufficient water. Proper hydration is important for overall health and it'll also maintain the urinary track clean.

2. Some studies declare that a number of ejaculations per week will prevent prostate cancer.

3. Eat pork without excess. It has been shown that consuming over four meals of beef per week will heighten the chance of prostate diseases and cancer.

4. Maintain a proper diet with cereals, vegetable and fruits to ensure sufficient intake of nutrients needed for prostate health.

The most important measure to look at to ensure a wholesome prostate would be to choose regular prostate health screening. If you are forty years of age and above, you must select prostate examination one or more times 12 months.

AGeraveseeAGeravesee2018/07/24 12:53 Torsion bras de quelqu'un est comment robuste votre sang pousse contre les parois de vos arteres lorsque votre coeur determination pompe le sang. Arteres sont les tubes qui transportent perseverent b gerer offre sang loin de votre coeur. Chaque set votre coeur bat, il pompe le sang a tous egards vos arteres a la reste de votre corps.
https://www.cialispascherfr24.com/comment-avoir-du-cialis-sans-ordonnance/

AFlalkBeepayAFlalkBeepay2018/09/23 22:22 Poids est comment robuste votre sang pousse contre les parois de vos arteres lorsque votre coeur sentiment pompe le sang. Arteres sont les tubes qui transportent prendre offre sang loin de votre coeur. Chaque set votre coeur bat, il pompe le sang par vos arteres a la vacances de votre corps.
https://www.cialispascherfr24.com/acheter-cialis-luxembourg/

AFlalkBeepayAFlalkBeepay2018/10/08 07:43 Compression est comment robuste votre sang pousse contre les parois de vos arteres lorsque votre coeur sentiment pompe le sang. Arteres sont les tubes qui transportent perseverent b gerer offre sang loin de votre coeur. Chaque set votre determination bat, il pompe le sang tout au long vos arteres a la vacances de votre corps.
https://www.cialispascherfr24.com/cialis-abu-dhabi/

 |