Ognacの雑感

木漏れ日々

目次

Blog 利用状況

書庫

ギャラリ

ボタンの長押

"長押"は "なげし" であって "ながおし" では無いですが、そんな事言っていたら煙たがられます。言葉は生き物なので"ながおし"が一般化するのかな?
最近の携帯やリモコンは物理的なボタンが少ないので、UIとしてボタンの長押で違う処理を実行するようになってます。
家電のリモコンは巨大化してワケワカ_ボタンが一杯あるので不要と思うのだか...もっとUIを考えて欲しいな!
この長押機能をWindowsFormアプリのボタンに実装して欲しいというリクエストがありました。標準機能ではないし、使い勝手も混乱を招きそうなので断りました。要求理由は「機能としては必要だが、ボタンを配置すると、不必要に押されてしまう。長押で機能を付加すれば表面上は隠せる」。
実装するとしたらどうするか?
ボタンClickイベントは button.down => button.click => button.up の順に発生します。button.Downの状態でマウスがボタンから外れてマウスアップしたら、Button.Clickは発生せずにButton.Upが発生します。
 このシーケンスで時計を計測、Downの時刻、Clickの時刻測定し長押間隔たっていれば......ではだめだ。長押中はClickされないんだ。
 Timerを使い、Downで起動 UPで停止 Timer_Tick でButtonの状態を見て長押の判定。とするのが正常系のようだが、異常系がありそうな気がする。
WebApliだったら Javascriptで処理する? 止めとくでしょうね。

投稿日時 : 2007年5月22日 11:10

Feedback

# re: ボタンの長押 2007/05/22 11:20 シャノン

> "長押"は "なげし" であって "ながおし" では無いですが

「なげし」と「ながおし」では、同じ文字でも意味が違いますから、両方併存するでしょ。

ボタンは押すものじゃなくてクリックするものだよね。
つまり、押して放して、初めてアクションを起こすのが本来の使い道だよね。
押しっぱなしって、ボタンの本来の使い道じゃないよね。

ま、Windows UI の「ボタン」と、現実世界の「ボタン」は違うもんだということでひとつ。

# re: ボタンの長押 2007/05/22 11:29 とっちゃん

Windowsに限らず、PC-OSのGUIで長押しは、難しいでしょうね。
やるとしたら、Shift、Ctrlあたりとの併用とか...あるいは、キャラクタキーとの併用とかw

簡単に押されたくないのなら、マウス+キーボードがよいかと。
そうしないと、スペースキーとか対応できないので、ボタンのようなコントロールを自作することに...w

# re: ボタンの長押 2007/05/22 11:31 ぽぴ王子

携帯電話のUIを考えるなら、ボタンじゃなくてキーですよね。
あれ、ボタンと言ってるけど、PCで対応するインターフェースは
キーボードなわけだし。
と、先にとっちゃんに書き込まれたのでやけくそage(流行ってるらしい)。

# re: ボタンの長押 2007/05/22 11:36 επιστημη

TuKaだったっけ、お年寄りのためのシンプルケータイってあったやないですか。アレの開発はかなり苦労したそうな。
おばぁちゃんが使うのでボタンをむやみに増やせません。
加えて"長押"で機能選択もできません。
おばぁちゃんはフツーに押しても"長押"だからだそうな。

# マナー・モードも存在しない。
#「電源切ればいぃやん」だってさ。
# その潔さや善し!

# re: ボタンの長押 2007/05/22 11:56 渋木宏明(ひどり)

スプリットボタンの方がスマートじゃない?>やるとしたら

# re: ボタンの長押 2007/05/22 12:08 Chuki

体言だから送らないもん!なんて言い返されそうですね。
長押「し」を送らなくても「ながおし」って読ますようになるのか。気持ち悪ぅ

ところで、Macの実装は長押しとは言わないの?

# re: ボタンの長押 2007/05/22 13:06 Ognac

>Windows UI の「ボタン」と、現実世界の「ボタン」は違うもんだということでひとつ
今後のために、開発側の言い訳と思わせない口実をみつけとこうっと。

>やるとしたら、Shift、Ctrlあたりとの併用とか...あるいは、キャラクタキーとの併用とかw
他のキーとのコンビネーションですね。

>キーボードなわけだし。
>と、先にとっちゃんに書き込まれたのでやけくそage(流行ってるらしい)。
どこで流行っているの?
キーボードの長押?....キーリピートしちゃう。 検出できるのだろうか? こっちの方が難しそう。

>おばぁちゃんはフツーに押しても"長押"だからだそうな。
まったく想像できなかったUI制約です。

>スプリットボタンの方がスマートじゃない?>やるとしたら
ボタンを引くという動作と長押 の違いの説明もややこしそうです

>ところで、Macの実装は長押しとは言わないの?
Macに実装されてるんですか?

# re: ボタンの長押 2007/05/22 14:49 刈歩 菜良

「ながおし」とはちと違うけれど、WindowsフォームでのToolTipの動きってある意味「ながおし」っぽくないですか?
一定時間マウスをコントロール上で止めとくとツールチップが表示されるっちゅうやつ。

同じ仕組み(理屈)で「ながおし」がサポートできるのではなかろうかと思いました。

# ボタンに「ながおし」機能を付加するのが良いか悪いかは別として。

# re: ボタンの長押 2007/05/22 15:14 渋木宏明(ひどり)

「長押し」自体には反対です。
PDA ならともかく、マウスなんかじゃ操作しづらいだけだと思うので。
「スプリットボタン」は「1つのボタンに複数の機能を盛り込みたい」という要件に対応するための例として書きました。
「ボタンを引く」って何???

# re: ボタンの長押 2007/05/22 16:23 Ognac

>「スプリットボタン」は「1つのボタンに複数の機能を盛り込みたい」という要件に対応するための例として書きました。
>「ボタンを引く」って何???
あ! 誤解しました。
 オルガンなどのパイプ類の長さ調節の引き出し型の調整ボタン(通じるかな、注射器のポンプの部分を引っ張って薬を吸い取る柄の部分など)をスプリットボタンと言ってましたので、それを想像してました。
そんなボタンを作るのかなぁっと思った次第で。そのほうが難しい。

# re: ボタンの長押 2007/05/22 16:33 Ognac

追記-- 上記の「スプリットポタン」はローカル用語のようでした。他の地域では通じないみたいです..wwwwww;;

# re: ボタンの長押 2007/05/22 16:42 Ognac

>同じ仕組み(理屈)で「ながおし」がサポートできるのではなかろうかと思いました
ToolTipの表示タイミングをHookするのは? どうしてるんだろう。 Providerが1つで複数のコントロールを扱うので、何らかの仕組みがあるのでしょうね、単純なHookではない気がします

# re: ボタンの長押 2007/05/22 22:24 Jitta

長押
なげし【▽長▽押】名
日本建築で、柱と柱との間に水平に取り付ける装飾的な横木。

明鏡国語辞典 (C) Taishukan 2002-2006


> ところで、Macの実装は長押しとは言わないの?
「ホールドし続ける」じゃないかなぁ?

> 異常系がありそうな気がする。
Button.up で、場所を見ないといけませんね。ボタン上で押し込み、ボタン外にドラッグ、離すと、Click は発生しませんが、Down/Up は発生するでしょう。
Shift, Ctrl, Alt との組み合わせが無難と思われ。

# re: ボタンの長押 2007/05/22 23:12 ぽぴ王子

> > ところで、Macの実装は長押しとは言わないの?
> 「ホールドし続ける」じゃないかなぁ?

ですよね。
自信がなかったのでヌルっとKANSAIしてしまったわけですが…
むしろ「長押させ」なんじゃね?とか思いました。
長押→長く押し続けたら動作
長押させ→動作を続けるために長く押し続ける

# re: ボタンの長押 2007/05/23 0:29 RAPT

左ボタンが MouseUp したとき、右ボタンも押下されていたら。
すなわち、右ボタンを押しながら左クリックで動作、とか。
誤操作対応なら、σ(^^)も、Ctrl,Alt,Shift あたりとの組み合わせを推奨するかなぁ。

# re: ボタンの長押 2007/05/23 1:19 Ognac

>Button.up で、場所を見ないといけませんね
>左ボタンが MouseUp したとき、右ボタンも押下されていたら。
やっぱり色々な異常系がありますねぇ。断ってよかった。
なんか言ってきたらCtrl,Alt,Shift あたりとの組み合わせの話をさせてもらいます。
 顧客は突拍子もない要望を持たれるものですね。

# re: ボタンの長押 2007/05/23 22:39 Jitta

ちなみに、某ソフトは [Ctrl]+[Alt]+[Shift]+[右ボタン]+[左クリック]

# re: ボタンの長押 2007/05/24 1:20 Ognac

>ちなみに、某ソフトは [Ctrl]+[Alt]+[Shift]+[右ボタン]+[左クリック]

????これで何をキックするの??
重大な隠し機能?

# re: ボタンの長押 2007/05/25 15:16 Chuki

なるほど、「長押させ」か。
そんな感じですね^^。

「↑↑↓↓←→←→LR」チャララララン

# re: ボタンの長押 2007/05/26 0:16 Jitta

> 重大な隠し機能?
はい。なので、どのソフトのどこで押すかはナイショ。Ognacさん、使ってるよ。

そうそう。[Shift]+クリック は、ちと、まずいかもしれない。「なんで?」と思った人は、“右”[Shift]を8秒以上押したままにしてみましょう。“左”[Shift]を4回押してもいいかもしんない。
デフォルトのままなら、何かがおこる。。。

# re: ボタンの長押 2007/05/26 2:54 Ognac

>“左”[Shift]を4回押してもいいかもしんない
こちらは知ってました。
>“右”[Shift]を8秒以上押したままにしてみましょう
知らなかった。

>Ognacさん、使ってるよ。
う! なんだろう。常用してるソフトは以外と少ないんです。
Vistaに変えてから、なおさら、限定されいます.
VS2005, 秀丸, WinFD, IME, Becky, Excel2003
IPY,PowerShell, IE7,紙
起こらない!! こつこつ調べようっと。

隠しクレジットの表示のアクションと見た!...Win3.1かWin95にあったような記憶がある...違ったかな。

# Terrific article! That is the kind of information that are meant to be shared around the internet. Shame on the search engines for no longer positioning this put up higher! Come on over and discuss with my web site . Thanks =) 2019/04/04 20:03 Terrific article! That is the kind of information

Terrific article! That is the kind of information that are meant
to be shared around the internet. Shame on the search
engines for no longer positioning this put up higher! Come
on over and discuss with my web site . Thanks =)

# What a stuff of un-ambiguity and preserveness of valuable experience on the topic of unexpected emotions. 2019/04/10 15:48 What a stuff of un-ambiguity and preserveness of v

What a stuff of un-ambiguity and preserveness of valuable experience on the topic of unexpected emotions.

# Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully 2019/07/31 10:34 Thanks in support of sharing such a pleasant thoug

Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully

# Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully 2019/07/31 10:35 Thanks in support of sharing such a pleasant thoug

Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully

# Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully 2019/07/31 10:36 Thanks in support of sharing such a pleasant thoug

Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully

# Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully 2019/07/31 10:37 Thanks in support of sharing such a pleasant thoug

Thanks in support of sharing such a pleasant thought, post is pleasant, thats why i have read it fully

# kDRPAUaufLzMYy 2021/07/03 2:29 https://amzn.to/365xyVY

Looking forward to reading more. Great blog post.Much thanks again. Keep writing.

# HrEuIXGVIy 2021/07/03 3:59 https://www.blogger.com/profile/060647091882378654

Pretty! This has been an incredibly wonderful article. Many thanks for providing this info.

# We're a group of volunteers and opening a new scheme in our community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you. 2022/03/23 5:13 We're a group of volunteers and opening a new sche

We're a group of volunteers and opening a new scheme in our
community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you.

# We're a group of volunteers and opening a new scheme in our community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you. 2022/03/23 5:14 We're a group of volunteers and opening a new sche

We're a group of volunteers and opening a new scheme in our
community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you.

# We're a group of volunteers and opening a new scheme in our community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you. 2022/03/23 5:15 We're a group of volunteers and opening a new sche

We're a group of volunteers and opening a new scheme in our
community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you.

# We're a group of volunteers and opening a new scheme in our community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you. 2022/03/23 5:16 We're a group of volunteers and opening a new sche

We're a group of volunteers and opening a new scheme in our
community. Your web site offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you.

# What's up friends, its impressive piece of writing concerning tutoringand completely explained, keep it up all the time. 2022/03/23 17:06 What's up friends, its impressive piece of writing

What's up friends, its impressive piece of writing concerning tutoringand completely
explained, keep it up all the time.

# What's up friends, its impressive piece of writing concerning tutoringand completely explained, keep it up all the time. 2022/03/23 17:07 What's up friends, its impressive piece of writing

What's up friends, its impressive piece of writing concerning tutoringand completely
explained, keep it up all the time.

# What's up friends, its impressive piece of writing concerning tutoringand completely explained, keep it up all the time. 2022/03/23 17:08 What's up friends, its impressive piece of writing

What's up friends, its impressive piece of writing concerning tutoringand completely
explained, keep it up all the time.

# What's up friends, its impressive piece of writing concerning tutoringand completely explained, keep it up all the time. 2022/03/23 17:09 What's up friends, its impressive piece of writing

What's up friends, its impressive piece of writing concerning tutoringand completely
explained, keep it up all the time.

タイトル
名前
Url
コメント